In Ubuntu, each folder can have its own filesystem.
Removing 3 or 4 older kernels will usually free up about a GB of space in your root drive. It's fairly easy to copy the name of the specific older kernel you want to remove from the results that dpkg -list | grep linux-image gives you in the terminal, and then use sudo apt-get purge and paste the copied name in. Rinse, repeat, admire the space you've freed up. "What kernel version am I using? What kernel versions do I have? Okay, purge that one." There are faster ways to do this, but I prefer the simplicity of this method mainly because I can understand each command along the way: It's much neater but a newcomer to Ubuntu/Linux may not be aware that they are there taking up space.Īs suggested, don't remove the current kernel and it's also advisable to keep the previous kernel version too, just in case you need to roll back to that one. The grub bootloader menu used to show all the older kernel versions on the main page, but they are now placed out of the way behind a sub-menu. They also then say to 'Reboot your system' (which seems to be so that you can see the cleaned up boot menu) so in this case isn't necessary.
The answer then says to 'update-grub2' when you're finished purging, which is likely to be out of date now: sudo update-grub should suffice for Ubuntu 14.04 onward. Sudo apt-get purge linux-image-x.x.x.x-generic Run the command below to remove the kernel you selected. When you know which kernel to remove, continue below to remove it. Next, type the command below to view/list all installed kernels on your system.įind all the kernels that are lower than your current kernel. Open terminal and check your current kernel: My preferred method is mostly this answer from penreturns where it's broken down into fairly simple understandable steps:
There's a number of ways to remove the old kernel versions and a range of different options can be found in the answers posted to: How do I remove old kernel versions to clean up the boot menu? Removing old kernel versions (as suggested already by homebrand) can free up a decent amount of space if you haven't yet got around to doing that. # This one-liner is deprecated since 18.04 If ] then snap set system refresh.retain=2 fi Snap list -all | while read snapname ver rev trk pub notes do # Will need English output for processing
Here is a script I run to free space on root partition