0

Running # apt-get dist-upgrade produced the following warnings/errors:

WARNING: missing /lib/modules/uname
depmod: ERROR: Bad version passed uname (2 times)
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit (4 times)

Everything happened in the dist-upgrade step right after Processing triggers for initramfs-tools (0.130ubuntu3.8) ... was printed out, so I guess it has something to do with that...

Does anyone have an idea what is going wrong and how I can fix it? Thanks!

Here is the complete output:

root:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libelf1 libglib2.0-0 libglib2.0-data libnss-systemd libpam-systemd libpython3.6 libpython3.6-minimal libpython3.6-stdlib libssl1.1 libsystemd0 libudev1 openssl python3-cryptography python3-gdbm
  python3.6 python3.6-minimal systemd systemd-sysv udev
19 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.3 MB of archives.
After this operation, 792 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnss-systemd amd64 237-3ubuntu10.22 [105 kB]
Get:2 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsystemd0 amd64 237-3ubuntu10.22 [204 kB]
Get:3 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpam-systemd amd64 237-3ubuntu10.22 [108 kB]
Get:4 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 systemd amd64 237-3ubuntu10.22 [2,901 kB]
Get:5 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 udev amd64 237-3ubuntu10.22 [1,101 kB]
Get:6 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libudev1 amd64 237-3ubuntu10.22 [53.8 kB]
Get:7 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 systemd-sysv amd64 237-3ubuntu10.22 [11.7 kB]
Get:8 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6 amd64 3.6.8-1~18.04.1 [1,418 kB]
Get:9 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.1 amd64 1.1.1-1ubuntu2.1~18.04.1 [1,295 kB]
Get:10 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6 amd64 3.6.8-1~18.04.1 [202 kB]
Get:11 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3.6-minimal amd64 3.6.8-1~18.04.1 [1,620 kB]
Get:12 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-stdlib amd64 3.6.8-1~18.04.1 [1,715 kB]
Get:13 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-minimal amd64 3.6.8-1~18.04.1 [533 kB]
Get:14 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libelf1 amd64 0.170-0.4ubuntu0.1 [44.8 kB]
Get:15 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libglib2.0-0 amd64 2.56.4-0ubuntu0.18.04.3 [1,169 kB]
Get:16 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libglib2.0-data all 2.56.4-0ubuntu0.18.04.3 [4,608 B]
Get:17 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 openssl amd64 1.1.1-1ubuntu2.1~18.04.1 [614 kB]
Get:18 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-gdbm amd64 3.6.8-1~18.04 [13.3 kB]
Get:19 http://at.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-cryptography amd64 2.1.4-1ubuntu1.3 [221 kB]
Fetched 13.3 MB in 2s (6,677 kB/s)
Preconfiguring packages ...
(Reading database ... 102639 files and directories currently installed.)
Preparing to unpack .../libnss-systemd_237-3ubuntu10.22_amd64.deb ...
Unpacking libnss-systemd:amd64 (237-3ubuntu10.22) over (237-3ubuntu10.21) ...
Preparing to unpack .../libsystemd0_237-3ubuntu10.22_amd64.deb ...
Unpacking libsystemd0:amd64 (237-3ubuntu10.22) over (237-3ubuntu10.21) ...
Setting up libsystemd0:amd64 (237-3ubuntu10.22) ...
(Reading database ... 102639 files and directories currently installed.)
Preparing to unpack .../libpam-systemd_237-3ubuntu10.22_amd64.deb ...
Unpacking libpam-systemd:amd64 (237-3ubuntu10.22) over (237-3ubuntu10.21) ...
Preparing to unpack .../systemd_237-3ubuntu10.22_amd64.deb ...
Unpacking systemd (237-3ubuntu10.22) over (237-3ubuntu10.21) ...
Preparing to unpack .../udev_237-3ubuntu10.22_amd64.deb ...
Unpacking udev (237-3ubuntu10.22) over (237-3ubuntu10.21) ...
Preparing to unpack .../libudev1_237-3ubuntu10.22_amd64.deb ...
Unpacking libudev1:amd64 (237-3ubuntu10.22) over (237-3ubuntu10.21) ...
Setting up libudev1:amd64 (237-3ubuntu10.22) ...
Setting up systemd (237-3ubuntu10.22) ...
(Reading database ... 102639 files and directories currently installed.)
Preparing to unpack .../00-systemd-sysv_237-3ubuntu10.22_amd64.deb ...
Unpacking systemd-sysv (237-3ubuntu10.22) over (237-3ubuntu10.21) ...
Preparing to unpack .../01-libpython3.6_3.6.8-1~18.04.1_amd64.deb ...
Unpacking libpython3.6:amd64 (3.6.8-1~18.04.1) over (3.6.7-1~18.04) ...
Preparing to unpack .../02-libssl1.1_1.1.1-1ubuntu2.1~18.04.1_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.1) over (1.1.0g-2ubuntu4.3) ...
Preparing to unpack .../03-python3.6_3.6.8-1~18.04.1_amd64.deb ...
Unpacking python3.6 (3.6.8-1~18.04.1) over (3.6.7-1~18.04) ...
Preparing to unpack .../04-python3.6-minimal_3.6.8-1~18.04.1_amd64.deb ...
Unpacking python3.6-minimal (3.6.8-1~18.04.1) over (3.6.7-1~18.04) ...
Preparing to unpack .../05-libpython3.6-stdlib_3.6.8-1~18.04.1_amd64.deb ...
Unpacking libpython3.6-stdlib:amd64 (3.6.8-1~18.04.1) over (3.6.7-1~18.04) ...
Preparing to unpack .../06-libpython3.6-minimal_3.6.8-1~18.04.1_amd64.deb ...
Unpacking libpython3.6-minimal:amd64 (3.6.8-1~18.04.1) over (3.6.7-1~18.04) ...
Preparing to unpack .../07-libelf1_0.170-0.4ubuntu0.1_amd64.deb ...
Unpacking libelf1:amd64 (0.170-0.4ubuntu0.1) over (0.170-0.4) ...
Preparing to unpack .../08-libglib2.0-0_2.56.4-0ubuntu0.18.04.3_amd64.deb ...
Unpacking libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.3) over (2.56.4-0ubuntu0.18.04.2) ...
Preparing to unpack .../09-libglib2.0-data_2.56.4-0ubuntu0.18.04.3_all.deb ...
Unpacking libglib2.0-data (2.56.4-0ubuntu0.18.04.3) over (2.56.4-0ubuntu0.18.04.2) ...
Preparing to unpack .../10-openssl_1.1.1-1ubuntu2.1~18.04.1_amd64.deb ...
Unpacking openssl (1.1.1-1ubuntu2.1~18.04.1) over (1.1.0g-2ubuntu4.3) ...
Preparing to unpack .../11-python3-gdbm_3.6.8-1~18.04_amd64.deb ...
Unpacking python3-gdbm:amd64 (3.6.8-1~18.04) over (3.6.7-1~18.04) ...
Preparing to unpack .../12-python3-cryptography_2.1.4-1ubuntu1.3_amd64.deb ...
Unpacking python3-cryptography (2.1.4-1ubuntu1.3) over (2.1.4-1ubuntu1.2) ...
Setting up libnss-systemd:amd64 (237-3ubuntu10.22) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for ureadahead (0.100.0-21) ...
ureadahead will be reprofiled on next reboot
Setting up systemd-sysv (237-3ubuntu10.22) ...
Setting up libelf1:amd64 (0.170-0.4ubuntu0.1) ...
Setting up libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.3) ...
No schema files found: doing nothing.
Setting up libglib2.0-data (2.56.4-0ubuntu0.18.04.3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up udev (237-3ubuntu10.22) ...
update-initramfs: deferring update (trigger activated)
Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.1) ...
Setting up openssl (1.1.1-1ubuntu2.1~18.04.1) ...
Installing new version of config file /etc/ssl/openssl.cnf ...
Setting up python3-gdbm:amd64 (3.6.8-1~18.04) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1) ...
Setting up python3-cryptography (2.1.4-1ubuntu1.3) ...
Setting up libpam-systemd:amd64 (237-3ubuntu10.22) ...
Setting up libpython3.6-minimal:amd64 (3.6.8-1~18.04.1) ...
Setting up libpython3.6-stdlib:amd64 (3.6.8-1~18.04.1) ...
Setting up python3.6-minimal (3.6.8-1~18.04.1) ...
Setting up libpython3.6:amd64 (3.6.8-1~18.04.1) ...
Setting up python3.6 (3.6.8-1~18.04.1) ...
Processing triggers for initramfs-tools (0.130ubuntu3.8) ...
update-initramfs: Generating /boot/initrd.img-uname
WARNING: missing /lib/modules/uname
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: Bad version passed uname
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with digit
depmod: ERROR: Bad version passed uname
Processing triggers for libc-bin (2.27-3ubuntu1) ...

Update, answering the question in the comments "What are the contents of /var/lib/initramfs-tools in your system?":

root:/var/lib/initramfs-tools# ll
total 24
drwxr-xr-x  2 root root 4096 Jun  5 13:47  ./
drwxr-xr-x 35 root root 4096 May 15 19:30  ../
-rw-r--r--  1 root root   77 Jun  4 10:52  4.15.0-50-generic
-rw-r--r--  1 root root   77 Jun 11 12:43  4.15.0-51-generic
-rw-r--r--  1 root root   65 Jun 11 12:06  uname
-rw-r--r--  1 root root   68 Jun  3 15:54 'uname -r'
root:/var/lib/initramfs-tools# cat 4.15.0-50-generic
acaea6c0d9c90f8bf83318577512b41aaa5f0ad8  /boot/initrd.img-4.15.0-50-generic
root:/var/lib/initramfs-tools# cat 4.15.0-51-generic
bd7c14ffe0b4389131448c3049b3530e05dad256  /boot/initrd.img-4.15.0-51-generic
root:/var/lib/initramfs-tools# cat uname
0a84ae4e46f9e3495fa7c7303692e405e61ebaf0  /boot/initrd.img-uname
root:/var/lib/initramfs-tools# cat 'uname -r'
053fe3e77f0f235dc9a1f8e327ab362e302cd459  /boot/initrd.img-uname -r
  • 1
    What’s the output of uname -a? – Stephen Kitt Jun 11 at 10:47
  • Linux Server 4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux – Thomas Popp Jun 11 at 10:48
  • I run "update-initramfs -k uname -r -c" manually afterwards and it worked like expected (no warnings or errors reported) – Thomas Popp Jun 11 at 10:50
  • Right, it’s not the uname output that’s wrong, it’s that something is using “uname” as a version number. – Stephen Kitt Jun 11 at 11:03
  • Yes, I also thinks so. It looks somehow like unameis used instead of uname -r in the course of apt-get dist-upgrade. This is why I referred to "Processing triggers for initramfs-tools": the next line seems completely wrong: update-initramfs: Generating /boot/initrd.img-uname. There should be a version string instead of just "uname" I strongly guess. Can anyone shed some light on what are the "triggers" (scripts?) for initramfs-tools? – Thomas Popp Jun 11 at 12:00
1

During the days before the apt-get dist-upgrade issue appeared, I run update-initramfs -k <version> -c several times.

In one case I can remember that I erroneously used just uname as parameter (instead of the `uname -r`). I was not aware that although this command produces warning and error messages it still creates an entry uname in /var/lib/initramfs-tools. And in the subsequent apt-get dist-upgrade which triggered initramfs-tools the erroneous update-initramfs command was run again.

So I think the solution is just to delete the 2 wrong uname-related entries in /var/lib/initramfs-tools.

  • Yes, this does seem to be the solution. – Stephen Kitt Jun 12 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.