Apt Package Caching using apt-cacher-ng on a Raspberry Pi

CanaKit Raspberry Pi 4 (4GB) Starter Kit (Amazon Affiliate)
US: https://amzn.to/3azJgrW
UK: https://amzn.to/2JdMq9o
CA: https://amzn.to/3bwiRvY
ES: https://amzn.to/2T06LnM (similar)
FR: https://amzn.to/3cvIZrs (similaire)
IT: https://amzn.to/2Ar74Sj (simile)
DE: https://amzn.to/2AqfWHQ (ähnlich)
IN: https://amzn.to/3ey6fWj
AU: https://amzn.to/2VTUt1C
NL: https://amzn.to/3f5NdsD (vergelijkbaar)

Raspberry Pi Playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZPvIdR5BEqDgO7DsGAla_AZ

Update Package List
sudo apt update
Install apt-cacher-ng
sudo apt install apt-cacher-ng
Change Hostname (optional)
sudo hostnamectl set-hostname apt-cacher-ng
sudo nano /etc/hosts

Change raspberrypi to apt-cacher-ng

Type control-o to save and control-x to exit.

Restart avahi-daemon
sudo systemctl restart avahi-daemon
Ping hostname
ping -c 4 apt-cacher-ng
View IP Address
ip a
Open Admin Page in Browser
http://apt-cacher-ng.local:3142
Configure Client
sudo nano /etc/apt/apt.conf.d/00aptproxy
Acquire::http::Proxy "http://apt-cacher-ng.local:3142";

Type control-o to save, control-x to exit.

Monitor apt-cacher-ng Log
tail -f /var/log/apt-cacher-ng/apt-cacher-ng.log
Install Package for Testing (lynx or any other)
sudo apt install lynx
Remove Package
sudo apt purge lynx
sudo apt autoremove
Check How Much Disk Space apt-cacher-ng is Using
du -sh /var/cache/apt-cacher-ng/

Leave a comment

Your email address will not be published. Required fields are marked *