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

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

We’ll walk you through the simple process of clearing the Apt Cache in Ubuntu, Debian, and Linux Mint in this guide. Which Linux distributions based on Debian employ the command-line package manager apt (Advanced Package Tool)?

It is used for Linux operating system software package management. Using a command-line interface, apt is used to install, update, upgrade, and delete programs from the system.

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 purpose as the some of the other apps or software might need to use it.

Many packets accumulate in the Cache as the system ages, taking up space. It is therefore preferable to practice emptying the store and Apt Cache.

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

Ubuntu, Debian, and Linux Mint have several methods for clearing the Apt Cache.

1. Using Apt Autoclean Command

Run the following command to remove the packages from Cache.

sudo apt autoclean

2. Using Apt Clean Command

Run the following command to delete the apt-cache.

sudo apt clean

Pro Tips: If you run ‘apt clean‘ with a parameter called ‘–dry-run‘, then it will show you the directories from which packages will be deleted that will easy and convenient for you to monitor the process.

 sudo apt clean --dry-run

Leave a Comment