Read more

Howto: Free disk space when /boot is full

Emanuel
December 05, 2016Software engineer at makandra GmbH

Easy mode

This method will remove automatically installed packages that no other packages depend on any more. This, of course, includes obsolete kernel versions, with the explicit exception of the currently running kernel, the kernel version that was installed on the system before that and, of course, the latest updated version of the kernel. However, it will also remove any and all other packages that have been marked as installed automatically but have no other packages depending on them. This could lead to unexpected removal of packages. So please check the output of sudo apt-get autoremove closely.

One-shot, manual method

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

sudo apt-get autoremove

Automatically remove unused packages

Edit /etc/apt/apt.conf.d/50unattended-upgrades and un-comment the line Unattended-Upgrade::Remove-Unused-Dependencies "true";.

Hard mode (for old Ubuntus)

uname -r prints currently used kernel version. You should not remove the current kernel, linux-image-generic and linux-image.

sudo apt-get clean
dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V
uname -r
sudo apt-get purge linux-image-x.y.z-generic
sudo apt-get autoremove

Removing multiple kernel versions with one command (long and short version):

sudo apt-get remove linux-image-1.2.4-generic
sudo apt-get remove linux-image-1.2.7-generic
sudo apt-get remove linux-image-1.2.8-generic
sudo apt-get remove linux-image-1.2.9-generic
sudo apt-get remove linux-image-1.2.{4,7..9}-generic

We have a tool, called geordi Show archive.org snapshot , which helps you to remove old kernels (available in geordi < 1.7.0). You need to run this command as root.

# rvm
gem install geordi
rvmsudo geordi purge-kernels
# rbenv
sudo gem install geordi
sudo geordi purge-kernels
Posted by Emanuel to makandra dev (2016-12-05 10:12)