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 removes the downloaded .deb files in /var/cache/apt/archives

Cache
~/tips/tip-cache-apt-clean-package-archives

sudo apt clean

Deletes the cached package files that apt keeps after each download to free disk space.

Package archives pile up on a small root disk after a few years of updates.

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

Every installed package leaves its .deb file behind in that folder. apt clean deletes all of them and does not touch installed software. apt autoclean only deletes files for versions that can no longer be downloaded, so it frees less. Reinstalling a package afterwards means downloading it again. In a Dockerfile, remove the package lists in the same layer as the install, with rm -rf /var/lib/apt/lists/*, or the space stays in the image.

Further reading: apt-get manual page

Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it

More Cache tips fincore /var/lib/example/data.db npm cache verify fc-cache -f -v ~/.local/share/fonts proxy_cache app; Cache-Control: no-cache All Cache tips (24) All topics

Link