Again... /boot is full [duplicate]
df -h
gives:
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 799M 81M 718M 11% /run
/dev/mapper/buildingbase--vg-root 287G 27G 246G 10% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/vda1 472M 466M 0 100% /boot
/dev/vdb1 2.0T 647G 1.4T 32% /mnt/bigstorage
tmpfs 799M 0 799M 0% /run/user/1000
my kernel
uname -r
4.4.0-72-generic
And than my installed kernels...
dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+'
as you can see NO OLDER KERNELS :-{
ii linux-image-4.4.0-72-generic 4.4.0-72.93 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-75-generic 4.4.0-75.96 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-78-generic 4.4.0-78.99 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-79-generic 4.4.0-79.100 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-81-generic 4.4.0-81.104 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-83-generic 4.4.0-83.106 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-87-generic 4.4.0-87.110 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-89-generic 4.4.0-89.112 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-91-generic 4.4.0-91.114 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-92-generic 4.4.0-92.115 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
How can I clean up /boot
?
Of course
sudo apt-get autoremove
is not working... not enough space
Apt's auto-removal logic assumes that you want newer kernels, and won't mark newer kernels as eligible for auto-removal
You are booted into the oldest kernel. Apt's auto-removal logic won't remove anything newer.
Your uptime
must be impressive!
-
Uninstall the kernels you are not using this will clean up your /boot:
sudo dpkg --remove linux-image-4.4.0-{75,78,79,81,83,87,89,91,92}-generic linux-image-extra-4.4.0-{75,78,79,81,83,87,89,91,92}-generic
Now you must make a choice: Do you wish to resume upgrading your kernel regularly? Or do you wish stay on your current kernel for the life of your release? (It's not a permanent choice, you can always change.)
If you desire to get off the kernel-upgrade train entirely, use apt-hold to prevent newer kernels from being downloaded and installed. Then you can stop here and ignore the rest of this answer. This is not the recommended option for new or unskilled users. [thanks to @panther]
If you desire to continue upgrading kernels, then continue with the following steps. This is the recommended option for new or unskilled users.
-
Update the kernel metapackages so they pull in the correct newest kernel
sudo apt clean linux-image-generic linux-image-extra-generic sudo apt install --reinstall linux-image-generic linux-image-extra-generic
-
Upgrade your system, which will pull in the latest kernel (-98) as well as test your package manager for proper function
sudo apt update sudo apt upgrade
-
Reboot into the new kernel. Rebooting monthly or even quarterly will prevent the problem from occurring again...or if you are a script guru, you can modify apt's auto-removal logic (it's just a script) to remove intermediate newer kernels.
Alternately, if you dislike rebooting, try Ksplice. Ksplice is an update service that automatically applies patches to the Linux kernel without requiring a reboot of the computer. [thanks to @panther]