Sometimes when I install software using the sudo apt-get install <package>
command the package may take minutes to be installed and in the end it may occupy some gb of space. If I uninstall it using sudo apt-get purge <package>
then it may be uninstalled in seconds and very little space (some kb or mb) may be removed from the original that it occupied when installed! Obviously that means that this is not a clean uninstall and that my pc is full of undeleted files. Why is that happening and how should I uninstall packages cleanly and fully?
When you install a package, it may also need to install dependencies for it to work - for instance installing
torcs
(e.g. withsudo apt-get install torcs
), it needstorcs-data
etc to work - they are also installed, and are fairly large in size (so also take time to download etc).When removing
torcs
(e.g. withsudo apt-get remove torcs
), it will likely leave thetorcs-data
packages and other no longer needed packages behind, taking up space. You can solve this by runningsudo apt-get autoremove <package>
, orsudo apt-get autoremove
after removing it withpurge
/remove
.You can also you the
--purge
option withautoremove
to remove left over configuration files.An extra way of clearing space is to use
sudo apt-get clean
, to clear out the repo information and cached packages which also take up space. You will likely need to runsudo apt-get update
afterwards.Here are the relevant entries from the manual page: