Clear APT Cache

Clear APT Cache

APT package manager allows to install packages on Debian, and Debian-based Linux distributions. APT store copy of the Debian packages (.deb) in the cache. It helps when want to reinstall package after removal. Package can be accessed locally without donwloading it again through the network. Clearing cache can free up disk space on the system. This tutorial shows how to clear APT cache.

The apt command accepts clean argument. Before clearing cache, --dry-run option can be used to see which directories will be removed.

sudo apt clean --dry-run

Output:

Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/lib/apt/lists/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin

To clear APT cache, run apt command with clean argument without any options:

sudo apt clean

Leave a Comment

Cancel reply

Your email address will not be published.