Skip to content

Instantly share code, notes, and snippets.

@yannvery
Created August 17, 2015 15:11
Show Gist options
  • Save yannvery/d5b4ebb94efcf505c4a1 to your computer and use it in GitHub Desktop.
Save yannvery/d5b4ebb94efcf505c4a1 to your computer and use it in GitHub Desktop.
Free disk place on linux server

To delete downloaded packages (.deb) already installed (and no longer needed)
sudo apt-get clean

To remove all stored archives in your cache for packages that can not be downloaded anymore (thus packages that are no longer in the repository or that have a newer version in the repository).
sudo apt-get autoclean

To remove unnecessary packages (After uninstalling an app there could be packages you don't need anymore)
sudo apt-get autoremove

To delete old kernel versions
sudo apt-get remove --purge linux-image-X.X.XX-XX-generic

If you don't know which kernel version to remove
dpkg --get-selections | grep linux-image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment