
sudo apt clean
or
sudo apt-get clean
Delete all useless files from the APT cache
The syntax is as follows to delete /var/cache/apt/archives/:
sudo apt autoclean
or
sudo apt-get autoclean
Verify that files are removed from /var/cache/apt/archives/ safely using the du command:
sudo du -ch /var/cache/apt/archives/
This explained APT cache and how to use the clean and autoclean apt-get command that clears out the downloaded package files from/var/cache/apt/archives/ folder. In short, use the sudo apt clean
and sudo apt autoclean
to free up disk space as part of scheduled maintenance on your Debian or Ubuntu Linux server.