Running on Ubuntu 20.04, low disk space on /boot error message came up while trying to update.
The upgrade needs a total of 228 M free space on disk '/boot'. Please free at least an additional 24,8 M of disk space on '/boot'.
in my /boot folder I have the following files:
/boot
total 460452
drwx------ 3 root root 4096 Jan 1 1970 efi
-rw-r--r-- 1 root root 184884 Aug 18 2020 memtest86+_multiboot.bin
-rw-r--r-- 1 root root 184380 Aug 18 2020 memtest86+.elf
-rw-r--r-- 1 root root 182704 Aug 18 2020 memtest86+.bin
drwx------ 2 root root 16384 Feb 2 2021 lost+found
-rw------- 1 root root 6219821 Jan 6 17:21 System.map-5.15.0-58-generic
-rw-r--r-- 1 root root 262181 Jan 6 17:21 config-5.15.0-58-generic
-rw------- 1 root root 11450528 Jan 6 17:21 vmlinuz-5.15.0-58-generic
-rw-r--r-- 1 root root 217500477 Jan 20 06:33 initrd.img-5.15.0-58-generic
-rw------- 1 root root 6221223 Jan 25 10:27 System.map-5.15.0-60-generic
-rw-r--r-- 1 root root 262215 Jan 25 10:27 config-5.15.0-60-generic
-rw------- 1 root root 11458344 Jan 25 10:29 vmlinuz-5.15.0-60-generic
lrwxrwxrwx 1 root root 25 Feb 9 06:53 vmlinuz.old -> vmlinuz-5.15.0-58-generic
lrwxrwxrwx 1 root root 25 Feb 9 06:53 vmlinuz -> vmlinuz-5.15.0-60-generic
lrwxrwxrwx 1 root root 28 Feb 9 06:53 initrd.img.old -> initrd.img-5.15.0-58-generic
lrwxrwxrwx 1 root root 28 Feb 9 06:53 initrd.img -> initrd.img-5.15.0-60-generic
-rw-r--r-- 1 root root 217514515 Feb 9 06:53 initrd.img-5.15.0-60-generic
drwxr-xr-x 4 root root 4096 Feb 9 06:54 grub
the command "uname -a" returns:
uname -a
Linux balazskocsis 5.15.0-60-generic #66~20.04.1-Ubuntu SMP Wed Jan 25 09:41:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
when I list out the dpkg packages I get:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
linux-generic-hwe-20.04
linux-headers-5.15.0-58-generic
linux-headers-5.8.0-63-generic
linux-headers-generic-hwe-20.04
linux-hwe-5.15-headers-5.15.0-58
linux-hwe-5.8-headers-5.8.0-63
linux-image-5.15.0-58-generic
linux-image-generic-hwe-20.04
linux-libc-dev:amd64
linux-modules-5.15.0-58-generic
linux-modules-extra-5.15.0-58-generic
I believe that I need to clean up with the purge command the kernel version 5-15.0-58:
sudo apt-get -y purge linux-modules-5.15.0-58-generic
but I am not really sure.
If I interpret this correctly:
lrwxrwxrwx 1 root root 25 Feb 9 06:53 vmlinuz.old -> vmlinuz-5.15.0-58-generic
lrwxrwxrwx 1 root root 25 Feb 9 06:53 vmlinuz -> vmlinuz-5.15.0-60-generic
the current version is the 5.15.0-60 and the ones with 5.15.0-58 can be removed.
Given the output of the /boot folder listing and the uname -a, would it be safe to remove the 5.15.0-58 version?
/boot
? It seems you have created a bottleneck for yourself by restricting the space in/boot
. A default Ubuntu installation share/boot
with/
so it doesn't run out of space. Also, you have the two latest kernels, which is also the default for Ubuntu (this is a safeguard so you can boot a previous kernel). To avoid problems, have at least 2GB space in/boot
. – Artur Meinild Feb 14 '23 at 08:58/boot
separate and too small, in some instances. If you've upgraded a machine through a few releases, it's entirely plausible to have a small/boot
by default. – popey Feb 14 '23 at 10:03purge
seems misused -- there are no files in /etc to remove. The use of-y
with anyremove
orpurge
command is unwise -- you are telling apt that it's okay to destroy your system without double-checking with you first. – user535733 Feb 14 '23 at 12:36--purge
for kernels, please see here. Old kernels leave a good amount of module files left (up to 3-4 MB per old kernel) if--purge
is not used - just FYI. – Artur Meinild Feb 14 '23 at 13:12