1

TL;DR - is there any reason /vmlinuz or /vmlinuz.old should be directories, not symlinks to images in boot? Any reason not to replace these (empty) directories with the proper symlinks?

The whole story: Recently when installing some packages, dpkg will give me the following error:

Setting up linux-image-3.13.0-147-generic (3.13.0-147.196) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.13.0-147-generic
Hmm. vmlinuz is a directory, which I did not expect.  I am
trying to create a symbolic link with that name linked to 
/ . Since a directory exists here, my assumptions 
are way off, and I am aborting.
dpkg: error processing package linux-image-3.13.0-147-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.13.0-147-generic; however:
  Package linux-image-3.13.0-147-generic is not configured yet.

The key part seems to be vmlinuz is a directory, which I did not expect. Sure enough, /vmlinuz and /vmlinuz.old are empty directories on this system, while on other Ubuntu systems I use, they are symbolic links to files in /boot.

Based on https://ubuntuforums.org/showthread.php?t=2259423, it sounds like I should be able to just make the expected symbolic links to the most recent and second most recent images in /boot, as nothing in /boot/grub/grub.cfg points to the vmlinuz or vmlinuz.old directories. On the other hand, I've also found pages like http://www.linfo.org/vmlinuz.html that say vmlinuz should be made by copying a compiled image. Based on the dates, I assume the latter is out of date.

This seems to be preventing apt from finishing installing new kernels, so I'd really like to fix this, by replacing the /vmlinuz and /vmlinuz.old directories with the symbolic links it seems like they should be. But this is on a critical research computer, so accidentally bricking the OS because there's a good reason those are supposed to be directories would definitely be a bad thing. Does anyone know any reason these should be directories and not symbolic links to images under /boot, or any reason I can't just fix that manually?

Edit: as requested:

$ ls -la /vmlinuz* /initrd.img*
lrwxrwxrwx 1 root root   34 Jul 26 19:13 /initrd.img -> boot/initrd.img-3.13.0-147-generic
lrwxrwxrwx 1 root root   34 Jul 20 20:06 /initrd.img.old -> boot/initrd.img-3.13.0-147-generic

/vmlinuz:
total 8
drwxr-xr-x  2 root root 4096 Nov  5  2016 .
drwxr-xr-x 24 root root 4096 Jul 26 19:13 ..

/vmlinuz.old:
total 8
drwxr-xr-x  2 root root 4096 Nov  5  2016 .
drwxr-xr-x 24 root root 4096 Jul 26 19:13 ..

Both initrd.img links are dangling at the moment, but I suspect that is because dpkg is being blocked from configuring the vm images:

$ ls -la /boot/
total 70412
drwxr-xr-x  3 root root    16384 Jul  9 17:27 .
drwxr-xr-x 24 root root     4096 Jul 26 19:13 ..
-rw-r--r--  1 root root  1166518 Oct 18  2016 abi-3.13.0-100-generic
-rw-r--r--  1 root root  1168650 May  2 10:48 abi-3.13.0-147-generic
-rw-r--r--  1 root root  1164852 Mar 10  2015 abi-3.13.0-46-generic
-rw-r--r--  1 root root   165931 Oct 18  2016 config-3.13.0-100-generic
-rw-r--r--  1 root root   166136 May  2 10:48 config-3.13.0-147-generic
-rw-r--r--  1 root root   165748 Mar 10  2015 config-3.13.0-46-generic
drwxr-xr-x  5 root root     4096 Jul  9 17:27 grub
-rw-r--r--  1 root root 19901593 Feb  6 06:40 initrd.img-3.13.0-100-generic
-rw-r--r--  1 root root 19869425 Dec  6  2017 initrd.img-3.13.0-46-generic
-rw-r--r--  1 root root   176500 Mar 12  2014 memtest86+.bin
-rw-r--r--  1 root root   178176 Mar 12  2014 memtest86+.elf
-rw-r--r--  1 root root   178680 Mar 12  2014 memtest86+_multiboot.bin
-rw-r--r--  1 root root      691 May  2 10:48 retpoline-3.13.0-147-generic
-rw-------  1 root root  3395101 Oct 18  2016 System.map-3.13.0-100-generic
-rw-------  1 root root  3413068 May  2 10:48 System.map-3.13.0-147-generic
-rw-------  1 root root  3389458 Mar 10  2015 System.map-3.13.0-46-generic
-rw-------  1 root root  5836896 Oct 18  2016 vmlinuz-3.13.0-100-generic
-rw-------  1 root root  5887024 May  2 10:48 vmlinuz-3.13.0-147-generic
-rw-------  1 root root  5814592 Mar 10  2015 vmlinuz-3.13.0-46-generic
  • 1
    By default everything is in /boot . Yes these are files not directories. What you do beyond the defaults is up to you to debug – Panther Jul 27 '18 at 01:51
  • Please add output of ls -al /vmlinuz* /initrd.img* to the question. – N0rbert Jul 27 '18 at 08:08
  • They should be symbolic links to boot/vmlinuz-xx.xx(new version) and boot/vmlinux-xx.xx(old version) respectively. It has been like this on 16.04 and 18.04, I have not used 14.04. Is your /root/initrd.img a directrory too? instead of symbolic link? – Bernard Wei Jul 27 '18 at 18:26
  • I don't have a /root/initrd.img, the /initrd.img and /initrd.img.old files are both (broken) symlinks. The image files in /boot are all regular files, not directories. – starfire119 Jul 27 '18 at 20:08

0 Answers0