Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: [SOLVED] dpkg: error: version 'uname -r' has bad syntax: version string has embedd

  1. #1
    Join Date
    Sep 2012
    Location
    North West England, UK
    Beans
    70
    Distro
    Ubuntu 14.04 Trusty Tahr

    Talking [SOLVED] dpkg: error: version 'uname -r' has bad syntax: version string has embedd

    Noticed the above error when upgrading via apt-get on my server. I don't have any problems with the server, no symptoms but the message seems to be consistent so would like to address it.

    Google only finds me this http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=369177 link which is a clear bug report on this error but dates back to 2006 and is on an old dpkg version.

    The below are the preceding lines output from 'apt-get upgrade', the final line is the end of the upgrade. A 'uname -r' returns "3.2.0-39-generic".

    Processing triggers for libc-bin ...
    ldconfig deferred processing now taking place
    Processing triggers for initramfs-tools ...
    dpkg: error: version 'uname -r' has bad syntax: version string has embedded spaces
    dpkg: error: version 'uname -r' has bad syntax: version string has embedded spaces
    update-initramfs: Generating /boot/initrd.img-3.2.0-39-generic
    Please can someone point me in the right direction, maybe I'm googling the wrong terms...I'm not a linux expert so am learning as I go.

    Thanks,

    K
    Last edited by KillerKelvUK; March 29th, 2013 at 10:22 PM. Reason: solved.

  2. #2
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,625
    Distro
    Ubuntu Development Release

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    Hi

    Can you post the output of

    Code:
    dpkg -C
    capital C above and

    Code:
    grep -rv ^# /etc/apt/sources.list{,.d}
    Kind regards
    Last edited by matt_symes; March 29th, 2013 at 04:14 PM.
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  3. #3
    Join Date
    Sep 2012
    Location
    North West England, UK
    Beans
    70
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    "dpkg -C" returns nothing i.e. no broken packages

    "grep -rv ^# /etc/apt/sources.list{,.d}" as below...

    /etc/apt/sources.list:
    /etc/apt/sources.list:
    /etc/apt/sources.list:
    /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ precise main restricted
    /etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ precise main restricted
    /etc/apt/sources.list:
    /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted
    /etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted
    /etc/apt/sources.list:
    /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ precise universe
    /etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ precise universe
    /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe
    /etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe
    /etc/apt/sources.list:
    /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ precise multiverse
    /etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ precise multiverse
    /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse
    /etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse
    /etc/apt/sources.list:
    /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
    /etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
    /etc/apt/sources.list:
    /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu precise-security main restricted
    /etc/apt/sources.list:deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
    /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu precise-security universe
    /etc/apt/sources.list:deb-src http://security.ubuntu.com/ubuntu precise-security universe
    /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu precise-security multiverse
    /etc/apt/sources.list:deb-src http://security.ubuntu.com/ubuntu precise-security multiverse
    /etc/apt/sources.list:
    /etc/apt/sources.list:
    /etc/apt/sources.list:
    /etc/apt/sources.list.d/jcfp-ppa-precise.list.save:deb http://ppa.launchpad.net/jcfp/ppa/ubuntu precise main
    /etc/apt/sources.list.d/jcfp-ppa-precise.list.save:deb-src http://ppa.launchpad.net/jcfp/ppa/ubuntu precise main
    /etc/apt/sources.list.d/jcfp-ppa-precise.list:deb http://ppa.launchpad.net/jcfp/ppa/ubuntu precise main
    /etc/apt/sources.list.d/jcfp-ppa-precise.list:deb-src http://ppa.launchpad.net/jcfp/ppa/ubuntu precise main
    /etc/apt/sources.list.d/tbfr-zabbix-precise.list:deb http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main
    /etc/apt/sources.list.d/tbfr-zabbix-precise.list:deb-src http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main

  4. #4
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,625
    Distro
    Ubuntu Development Release

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    Hi

    Maybe a ppa problem ? Have you tried disabling the ppas to implicate/eliminate them ?

    This is not an error i have seen before.

    Anyway, can you post the full output of

    Code:
    sudo apt-get install -f
    Kind regards
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  5. #5
    Join Date
    Sep 2012
    Location
    North West England, UK
    Beans
    70
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    Sorry should have said thanks on my first reply so thanks

    Quote Originally Posted by matt_symes View Post
    Maybe a ppa problem ? Have you tried disabling the ppas to implicate/eliminate them ?
    What's the best way to do this...just comment out the lines in the sources.list file?

    Code:
    sudo apt-get install -f
    gives me...

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  6. #6
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    Interesting. Looks like some script erroneously uses single quotes instead of backticks, i.e.
    Code:
    'uname -r'
    instead of
    Code:
    `uname -r`
    Could you please post the output of
    Code:
    grep 'uname -r' /usr/sbin/update-initramfs /var/lib/dpkg/info/*
    Last edited by schragge; March 29th, 2013 at 08:35 PM.

  7. #7
    Join Date
    Sep 2012
    Location
    North West England, UK
    Beans
    70
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    Sure..."grep 'uname -r' /var/lib/dpkg/info/*" gives me...

    /var/lib/dpkg/info/keyboard-configuration.config: kern=`uname -r`
    /var/lib/dpkg/info/keyboard-configuration.postinst: kern=`uname -r`
    /var/lib/dpkg/info/libc6:amd64.preinst: kernel_rev=$(uname -r | sed 's/\([0-9]*\.\)\{1,2\}\([0-9]*\)\(.*\)/\2/')
    /var/lib/dpkg/info/libc6:amd64.preinst: kernel_ver=`uname -r`
    /var/lib/dpkg/info/libc6:amd64.preinst: kernel_ver=`uname -r`
    /var/lib/dpkg/info/linux-image-3.2.0-38-generic.prerm:chop($running=`uname -r`);
    /var/lib/dpkg/info/linux-image-3.2.0-39-generic.prerm:chop($running=`uname -r`);
    /var/lib/dpkg/info/makedev.postinst:kern_rev1=`uname -r | sed -e 's@^\([^.]*\)\..*@\1@'`
    /var/lib/dpkg/info/makedev.postinst:kern_rev2=`uname -r | sed -e 's@^[^.]*\.\([^.]*\)\..*@\1@'`
    /var/lib/dpkg/info/postfix.preinst: if dpkg --compare-versions "`uname -r`" lt 2.6.0 ; then

  8. #8
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    Nothing unusual so far. Try
    Code:
    grep 'uname -r' `which update-initramfs`
    BTW, why do you have makedev installed? It's usually not needed on a modern Linux system that uses udev.
    Last edited by schragge; March 29th, 2013 at 08:45 PM.

  9. #9
    Join Date
    Sep 2012
    Location
    North West England, UK
    Beans
    70
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    ...

    if [ -f /boot/initrd.img-`uname -r` ]; then
    version=`uname -r`

  10. #10
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,625
    Distro
    Ubuntu Development Release

    Re: dpkg: error: version 'uname -r' has bad syntax: version string has embedded space

    Hi

    This is an odd one schragge. I've never come across this one before. It's a good idea to search the scripts.

    @OP. This command below will rename all your ppa files from *.list to *.old. It's reversible easily enough.

    You can copy and paste into the terminal. It will cut the search down.

    Code:
    sudo rename -v 's/\.list$/\.old/' /etc/apt/sources.list.d/*.list
    Code:
    sudo apt-get update
    You can then run the same command that was giving you the error before.

    Kind regards
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •