Safest way to clean up boot partition
Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
Case I: if /boot is not 100% full and apt is working
1. Check the current kernel version
It will shows the list like below:
2. Remove the OLD kernels
2.a. List the old kernel
You will get the list of images something like below:
2.b. Now its time to remove old kernel one by one as
When you're done removing the older kernels, you can run this to remove ever packages you won't need anymore:
And finally you can run this to update grub kernel list:
Case II: Can't Use apt
i.e. /boot is 100% full
apt
i.e. /boot is 100% fullNOTE: this is only if you can't use apt to clean up due to a 100% full /boot
1. Get the list of kernel images
Get the list of kernel images and determine what you can do without. This command will show installed kernels except the currently running one
You will get the list of images somethign like below:
2. Prepare Delete
Craft a command to delete all files in /boot for kernels that don't matter to you using brace expansion to keep you sane. Remember to exclude the current and two newest kernel images. From above Example, it's
3. Clean up what's making apt grumpy about a partial install.
4. Autoremove
Finally, autoremove to clear out the old kernel image packages that have been orphaned by the manual boot clean.
5. Update Grub
6. Now you can update, install packages
ИСТОЧНИК: https://gist.github.com/ipbastola/2760cfc28be62a5ee10036851c654600
Last updated