How To Clear Apt Cache In Ubuntu, Debian, And Linux Mint

How To Clear Apt Cache In Ubuntu, Debian, And Linux Mint

In this tutorial, we will show you the easy way to clear Apt Cache in Ubuntu, Debian, and Linux Mint. apt (Advanced Package Tool) is a command-line package manager used in Debian-based Linux distributions?  It is used to manage software packages on a Linux operating system. apt is used to install, update, upgrade, and remove packages from the system with a simple command-line interface.

Generally, packages are stored in the Cache folder being installed on the system. Most of the packages are stored in the Cache directory which is located at ‘/var/cache/apt/archives’. Apt stored packages in the cache for future usage as the other software might need to use it.

But as the system gets older, a lot of packages get stored in the Cache occupying the space. So, it’s better to practice clearing Apt Cache and clearing the storage.

How To Clear Apt Cache In Ubuntu, Debian, And Linux Mint

There are multiple ways to clear Apt Cache in Ubuntu, Debian, and Linux Mint-based operating systems.

Apt Autoclean Command

Run the following command to remove the packages from Cache.

sudo apt autoclean

Apt Clean Command

Run the following command to delete the apt-cache.

sudo apt clean

 

If you run ‘apt clean‘ with a parameter called ‘–dry-run‘, then it will show you the directories from which packages will be deleted, and will not actually delete the packages.

 sudo apt clean --dry-run
READ More Relevant Stuff:  Exclude Specific Packages From Yum Update In RHEL/CentOS

Leave a Reply

Your email address will not be published. Required fields are marked *