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/

Raspberry Pi Raspbian Buster Desktop Initial Setup

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

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)

Update Package List
sudo apt update
Update Software
sudo apt upgrade

Raspberry Pi Raspbian Lite Initial (Command Line) Setup

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

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)

Download Raspberry Pi Imager and Raspbian Buster Lite

https://www.raspberrypi.org/downloads/

Login to the Raspberry Pi

The default username is “pi” and password is “raspberry”.

Increase Console Font Size (optional)
sudo dpkg-reconfigure console-setup
Setup Apt Package Proxy (optional)
sudo nano /etc/apt/apt.conf.d/00aptproxy

Enter the following line. Type control-o to save and control-x to exit.

Acquire::http::Proxy "http://<ip_of_proxy>:3142";
Configure System
sudo raspi-config
Reboot System
systemctl reboot
Shutdown System
systemctl poweroff
Update Package List
sudo apt update
Update Software
sudo apt upgrade