APT maintains a package cache where it stores .deb files it has downloaded and installed. This usually lives in /var/cache/apt/archives, and can sometimes take up many hundreds of megabytes on your computer. You can have APT clean out the package cache by running apt-get clean, which deletes all the cached .deb files. Alternatively, you can run apt-get autoclean, which deletes cached .deb files that are beyond a certain age, thereby keeping newer packages.
If you try running apt-get install with packages you already have installed, APT will consider your command to be apt-get update and see whether new versions are available for download.
The last day-to-day package operation is, of course, removing things you no longer want. This is done through the apt-get remove command, as follows:
apt-get remove firefox
Removing packages can be dangerous, because APT also removes any software that relies on the packages you selected. For example, if you were to run apt-get remove libgtk2.0-0 (the main graphical toolkit for Ubuntu), you would probably find that APT insists on removing more than a hundred other things. The moral of the story is this: When you remove software, read the APT report carefully before pressing Y to continue with the uninstall.
A straight apt-get remove leaves behind the configuration files of your program so that if you ever reinstall it you do not also need to reconfigure it. If you want the configuration files removed as well as the program files, run this command instead:
apt-get remove --purge firefox
That performs a full uninstall.
Was this article helpful?