Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

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

  1. #11
    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

    @matt_symes...

    Happy to do as you suggest but atm I've no easy way to replicate the message on demand...its so far only presented when I've got updates to apply (sudo apt-get upgrade). Is there a way I can quickly "re-do" (my words) the initramfs set up which seems to be linked to this problem, I'm thinking this might generate the error and allow an easy test of your suggestion?

  2. #12
    Join Date
    Apr 2012
    Beans
    5,060

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

    ... I wonder if the OP has a kernel file or initrd.img file in /boot that somehow got renamed something like "initrd.img-uname -r-generic-pae" or "vmlinuz-(uname -r)-generic" due to some previous mishap, and a script is tripping over that?

  3. #13
    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

    Quote Originally Posted by steeldriver View Post
    ... I wonder if the OP has a kernel file or initrd.img file in /boot that somehow got renamed something like "initrd.img-uname -r-generic-pae" or "vmlinuz-(uname -r)-generic" due to some previous mishap, and a script is tripping over that?
    Erm...I'm not fully understanding but...

    me@myserver/boot$ ls -la
    total 50182
    drwxr-xr-x 5 root root 1024 Mar 29 14:24 .
    drwxr-xr-x 25 root root 4096 Mar 23 18:37 ..
    -rw-r--r-- 1 root root 792830 Feb 19 12:58 abi-3.2.0-38-generic
    -rw-r--r-- 1 root root 792830 Feb 28 01:09 abi-3.2.0-39-generic
    -rw-r--r-- 1 root root 140488 Feb 19 12:58 config-3.2.0-38-generic
    -rw-r--r-- 1 root root 140488 Feb 28 01:09 config-3.2.0-39-generic
    drwxr-xr-x 3 root root 2048 Jan 1 1970 efi
    drwxr-xr-x 3 root root 4096 Mar 23 18:37 grub
    -rw-r--r-- 1 root root 15169141 Mar 23 18:34 initrd.img-3.2.0-38-generic
    -rw-r--r-- 1 root root 15170883 Mar 29 14:24 initrd.img-3.2.0-39-generic
    -rw-r--r-- 1 root root 2867173 Jan 13 12:28 initrd.img-uname -r
    drwxr-xr-x 2 root root 12288 Jan 11 23:41 lost+found
    -rw-r--r-- 1 root root 176764 Nov 27 2011 memtest86+.bin
    -rw-r--r-- 1 root root 178944 Nov 27 2011 memtest86+_multiboot.bin
    -rw------- 1 root root 2887333 Feb 19 12:58 System.map-3.2.0-38-generic
    -rw------- 1 root root 2888361 Feb 28 01:09 System.map-3.2.0-39-generic
    -rw------- 1 root root 4968592 Feb 19 12:58 vmlinuz-3.2.0-38-generic
    -rw------- 1 root root 4971472 Feb 28 01:09 vmlinuz-3.2.0-39-generic
    Note the "-rw-r--r-- 1 root root 2867173 Jan 13 12:28 initrd.img-uname -r"...is this it?

  4. #14
    Join Date
    Feb 2013
    Beans
    Hidden!

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

    Yep. Good call, steeldriver. @OP: just remove that file:
    Code:
    sudo rm /boot/initrd.img-uname*

  5. #15
    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

    Great guys thanks...but how do I check it worked?


  6. #16
    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

    Assuming it's happening when generating an initramfs you can use

    Code:
    sudo update-initramfs -u
    This will rebuild the initial ram disk for you current kernel.

    EDIT:

    Good call steeldriver. That may well be it.

    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

  7. #17
    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

    okay so not quite...

    sudo update-initramfs -u
    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
    But I guess now we have a check that replicates the problem...

    Appreciate the effort guys, what do I try next?

  8. #18
    Join Date
    Feb 2013
    Beans
    Hidden!

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

    Check that you actually have removed that file. If not, remove it again:
    Code:
    sudo rm -v /boot/initrd.img-uname*
    then re-run update-initramfs, also with -v (--verbose) to see what happens:
    Code:
    sudo update-initramfs -uv
    If the file appears again, try
    Code:
    sudo update-initramfs -d 'uname -r'
    Note the single quotes, be cautious not to remove the initrd for current kernel.
    Last edited by schragge; March 29th, 2013 at 10:07 PM.

  9. #19
    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

    Definitely removed...result of your command...rm: cannot remove `/boot/initrd.img-uname*': No such file or directory

  10. #20
    Join Date
    Feb 2013
    Beans
    Hidden!

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

    Also check the directory /var/lib/initramfs-tools/, it may contain checksum for the wrong version. Now, I guess the only proper way to remove an initrd is
    Code:
    sudo update-initramfs -d 'uname -r'
    Note single quotes around uname -r, be cautious not to remove initrd for the current kernel. If this doesn't work, try:
    Code:
    sudo rm -v /var/lib/initramfs-tools/uname*
    Last edited by schragge; March 29th, 2013 at 10:10 PM.

Page 2 of 3 FirstFirst 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
  •