Whenever new programs are installed in Linux Mint via apt-get (this includes Linux Mint updates),Â the installation packages (*.deb files) are downloaded and cached in the system before installation. These files tend to consume hundreds of mega bytes of space over period of time. You can get rid of these files and save your disk space with following 3 steps-
1. Run the following command in the terminal:
sudo apt-get clean
The above command clears out the local repositories of retrieved package files. It removes everything but the lock file (used to indicate to the system files that are in use) from ‘/var/cache/apt/archives/’ and ‘/var/cache/apt/archives/partial/’.
2. Run the following command in the terminal:
sudo apt-get autoclean
Like clean, the above command clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless.
3. Run the following command in the terminal:
sudo apt-get autoremove
The above command is used to remove packages that were automatically installed to satisfy dependencies for some package and that are no more needed (i.e. the package for which the dependencies were installed has been removed by the user).
It is recommended that you run these commands on your system once every month in order to save the disk space.