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.
There are 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?
My preferred method is mostly this answer from penreturns where it's broken down into fairly simple, understandable steps:
Open terminal and check your current kernel:
uname -r
DO NOT REMOVE THIS KERNEL!
Next, type the command below to view/list all installed kernels on your system.
dpkg --list | grep linux-image
Find all the kernels that are lower than your current kernel.
When you know which kernel to remove, continue below to remove it.
Run the command below to remove the kernel you selected.
sudo apt-get purge linux-image-x.x.x.x-generic
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. 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 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. It's much neater but a newcomer to Ubuntu/Linux may not be aware that they are there taking up space.
As 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.
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:
"What kernel version am I using? What kernel versions do I have? Okay, purge that one."
Rinse, repeat, admire the space you've freed up.
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.
Removing 3 or 4 older kernels will usually free up about a GB of space in your root drive.
-y
in the apt-get command is not really necessary. If you omit it apt-get will ask you (only once), if all piped packages should be removed. Imho it's better to not use-y
, it gives you one more possibility to check (besides the second command mentioned above). For me this freed 15GB on the root partition! – Boris Däppen Jan 07 '17 at 13:03dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
tried to remove the currently installed kernel version in my system. Be careful not to make your system unbootable. – HelloWorld101 Aug 09 '18 at 12:50uname -r
to find the current kernel and took care not to remove it. If the command provided byhomebrand
to check which packages will be purged does not show the current kernel, then you should be safe running the purge command mentioned by him. – HelloWorld101 Aug 29 '18 at 13:25