Did you make a backup of the system before you started?
Here's a reasonable guide for how-to, https://www.cyberciti.biz/faq/how-to...ntu-24-04-lts/
However, I think they left out verifying that you have sufficient free storage available, especially in /boot/ if /boot is a separate partition. Running out of space where new kernels get placed, which is in /boot/, is difficult to recover from, so it is best to avoid it by ensuring there's about 300MB free there. 300MB should be more than enough.
If you don't have enough space in /boot/, keep reading. Otherwise, everything below here won't help you.
For example, my /boot/ contains these files today:
Code:
$ ls -F /boot/
config-5.15.0-121-generic initrd.img-5.15.0-121-generic System.map-5.15.0-56-generic
config-5.15.0-122-generic initrd.img-5.15.0-122-generic vmlinuz@
config-5.15.0-56-generic initrd.img-5.15.0-56-generic vmlinuz-5.15.0-121-generic
efi/ initrd.img.old@ vmlinuz-5.15.0-122-generic
grub/ System.map-5.15.0-121-generic vmlinuz-5.15.0-56-generic
initrd.img@ System.map-5.15.0-122-generic vmlinuz.old@
If you look closely, you'll see there are 3 kernels, each a different version, there. Only 2 really are needed - the last one installed and the one that worked before it.
To see the space used in the /boot/ partition (or ZFS pool, called bpool, OR LVM LV /boot/), use
Code:
$ df -Th /boot/
Filesystem Type Size Used Avail Use% Mounted on
bpool/BOOT/ubuntu_d0wbmk zfs 1.8G 385M 1.4G 22% /boot
So, with ZFS, looks like the installation created the bpool to be 1.8GB in size, but only 385MB is used for those 3 kernels. I should clean up one of the kernels, do that referencing my files above, we can see that kernel 5.15.0-56 needs to go.
The kernel files themselves are:
Code:
$ ll vmlinuz-5.15.0-*
-rw------- 1 root root 11699080 Aug 9 04:16 vmlinuz-5.15.0-121-generic
-rw------- 1 root root 11700328 Aug 29 08:47 vmlinuz-5.15.0-122-generic
-rw-r--r-- 1 root root 11551392 Dec 17 2022 vmlinuz-5.15.0-56-generic
Code:
$ sudo apt remove --purge linux-image-5.15.0-56-generic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
linux-image-5.15.0-56-generic* linux-modules-5.15.0-56-generic*
linux-modules-extra-5.15.0-56-generic*
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 482 MB disk space will be freed.
Do you want to continue? [Y/n] y
....
Purging configuration files for linux-modules-extra-5.15.0-56-generic (5.15.0-56.62) ...
Purging configuration files for linux-modules-5.15.0-56-generic (5.15.0-56.62) ...
Purging configuration files for linux-image-5.15.0-56-generic (5.15.0-56.62) ...
rmdir: failed to remove '/lib/modules/5.15.0-56-generic': Directory not empty
So, the linux-image-5.15.0-56-generic is gone as is the vmlinux.... version for it. Trust me.
Cleaning up the modules that are specific to the kernel failed. Let's see of apt autoremove will address that. Nope, it failed. While I'm here, I also see that the linux-headers-5.15.0-56 linux-headers-5.15.0-56-generic packages need to be removed. They aren't useful without the kernel anyways.
Code:
sudo apt purge linux-headers-5.15.0-56 linux-headers-5.15.0-56-generic
Removed them.
Code:
$ df -Th /boot/
Filesystem Type Size Used Avail Use% Mounted on
bpool/BOOT/ubuntu_d0wbmk zfs 1.8G 257M 1.5G 15% /boot
That's a little better.
It is possible that other file systems are full too. I think for an upgrade, having 5GB free for / is a reasonable amount for a server. It is probably less, but better safe, right?
The bad things about backups is that we only know we need them AFTER there's a problem. OS upgrades are one of those high-risk tasks. Basically, an OS upgrade is like replacing the engine in your car. If something doesn't fit, that car won't start or move. Think of backups like having a tow truck available, standing by, just in case it is needed.