brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: apt clean empties the cache of downloaded .deb files

Apt
~/tips/tip-apt-clean-package-cache

sudo apt clean

Deletes cached package downloads to free disk space on the system.

On a small VPS, the apt download cache is one of the first places I look for wasted space.

du -sh /var/cache/apt/archives
sudo apt clean

Downloaded .deb files stay in /var/cache/apt/archives until you remove them. apt clean deletes all of them and is safe, because apt downloads them again when needed. apt autoclean only removes files that can no longer be downloaded. The package lists in /var/lib/apt/lists stay in place, so searches keep working without a new update. Run it again after big upgrades.

Further reading: apt-get manual page

More Apt tips sudo apt-mark minimize-manual apt list '~c' grep -E ' (install|upgrade|remove) ' /var/log/dpkg.log | tail -o Dpkg::Options::="–force-confold" upgrade sudo apt-get -d -y full-upgrade All Apt tips (42) All topics

Link