LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   apt upgrade creating initrd files for long gone kernels (https://www.linuxquestions.org/questions/ubuntu-63/apt-upgrade-creating-initrd-files-for-long-gone-kernels-4175678942/)

smaclennan 07-17-2020 09:19 PM

apt upgrade creating initrd files for long gone kernels
 
I always build my own kernels. I have now upgraded from 16.04 to 18.04.

I am trying to get a clean apt upgrade, but every time it fails trying to create tons of initrd files for long gone kernels.

They are not in /lib/modules, they are not in /boot, they are not in grub.cfg... where is Ubuntu finding these versions?

berndbausch 07-17-2020 09:54 PM

A little more information might be helpful.
Such as:
You have already upgraded to 18.04, correct?
Which command(s) you enter (I suppose it's apt upgrade).
What is the command output.
What error messages do you see.
What is the outcome. I know it fails, but are there any files lying around or messages in log files etc.

EDIT: If you don't want the kernel package(s) to be upgraded, you can mark them with apt-mark, it seems.

uteck 07-17-2020 09:56 PM

How did you remove the old kernels? The problem seems like apt thinks they are still installed, so trying to remove them with apt might clear it up.

smaclennan 07-17-2020 10:46 PM

I have upgraded to 18.04.

Yes: apt upgrade

None of the kernels where installed using apt. I built them and copied them into place. But I did use update-initramfs and update-grub. They where removed with good ol' rm.

Example error... there are many many of these:

update-initramfs: Generating /boot/initrd.img-5.4.20+
WARNING: missing /lib/modules/5.4.20+
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/5.4.20+: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_YEiINl/lib/modules/5.4.20+/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_YEiINl/lib/modules/5.4.20+/modules.builtin: No such file or directory


I normally don't build kernels that need an initramfs... but this is a work computer and they picked LVM for the root device :(

It wasn't a problem with 16.04 since I had to apt upgrade cleanly to do the release upgrade.

smaclennan 07-17-2020 10:58 PM

Found it!

/var/lib/initramfs-tools/*


All times are GMT -5. The time now is 03:35 PM.