Debian commands to clean up after apt-get Debian commands to clean up after apt-get

April 14, 2021

debian bash

I like to keep my Debian Linux machine clean and up-to-date. I regularly run the update to get the latest versions and security patches. (I have disabled the default auto-update as it open happened when i was on a limited interenet connection)

After running

apt-get update
apt-get upgrade
apt-get dist-upgrade

Regularly find that a lot of files are left behind. So i started a script to cleanup afterwards.

apt-get clean
apt-get autoclean
apt-get autoremove
apt-get purge

using docker, there is also space to reclain using (WARNING: adding the -a at the end deletes all of them!)

docker system prune 

Interested to hear from everyone about how else they clean up space after installing and upgrading their computers...

If you would like to contact me you can either use this form on or via Twitter @andylondon