How to Free Up Space by Removing Unwanted Packages

On Debian-based systems, the APT package management system stores downloaded packages even after you have installed them and keeps the handy in case you want to reinstall without having to re-download. After a certain amount of time, you might decide you no longer need to keep these packages around, especially if they are taking up a lot of space.

First, you can start by removing any deb files cached in the archives:

# cd /var/cache/apt/archives

# rm -f *.deb

Next, remove any packages you have installed that you no longer use. Be careful with this. Make sure they are actually programs you no longer need. Just because do not recognize something does not mean it is unneeded.

# apt-get remove [packagename]

For example, to remove a program called “fakeprogram”, type:

# apt-get remove fakeprogram

Depending on how much package management you have done and the size of packages you have downloaded, you could free up a considerable amount of space on your server.