Apt-caching server in Linux : apt-cacher-ng

Опубликовано: 29 Октябрь 2024
на канале: Kunal Attri
211
4

In this video, I have demonstrated how to set up apt-cacher-ng for host and client machines.
Apt-caching is a way to cache apt packages and repos on a cache-server and then distribute them much more faster on LAN systems.

Host commands:
1. Installation and start
sudo apt install apt-cacher-ng
sudo systemctl start apt-cacher-ng
sudo systemctl enable apt-cacher-ng
sudo systemctl status apt-cacher-ng

2. Allow HTTPS packages
sudo nano /etc/apt-cacher-ng/acng.conf
... In this file, Uncomment line "PassThroughPattern .*"
... And then save the file ... Ctrl+X ... Y ... Enter
sudo systemctl restart apt-cacher-ng

3. Set up firewall to allow traffic through port 3142
sudo ufw allow 3142

4. Additionally, for allowing auto configuration on clients
sudo apt install avahi-daemon


Client commands
1. Auto configuration
sudo apt install auto-apt-proxy
.... you might need to restart system

OR
2. Manual configuration
.... write one line to 00aptproxy file ... either do (a) or (b).. both are similar
(a) sudo echo "Acquire::http::Proxy \"http://SERVERIP:3142\";" [right angled bracket] /etc/apt/apt.conf.d/00aptproxy

(b) sudo nano /etc/apt/apt.conf.d/00aptproxy
..... In this file, write:
Acquire::http::Proxy "http://SERVERIP:3142";

..... Then save the file ... Ctrl+X ... Y ... Enter


Seeing live logs on Host system
tail [hyphen]f /var/log/apt-cacher-ng/apt-cacher.log

Web interface for report and clearing cache and few other stuff
In browser go to:
http://SERVERIP:3142/acng-report.html
... If you are on host system only, you can replace SERVERIP with localhost

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TIMESTAMPS
00:00 Apt-caching in linux
01:19 Setting up Host Caching Server
05:15 Setting up Client: Auto-configuration
08:18 Changing firewall settings in Caching server
09:45 Setting up Client: Manual configuration
13:54 Checking how it's working
17:14 Caching on Host machine also
19:15 Setting client on Kali: Autoconfiguration
21:30 Secure acces to Caching server
22:50 Endnote

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Subscribe to us for more videos!!!

BG Music: Tropicana - Soundroll

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Python:    • Python  

Pokemon FireRed:    • Pokemon FireRed  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you own any rights to the content we use in our videos and want us to provide credits or remove the content , kindly contact us at [email protected] . We will solve it out with a hypothetic cup of tea(●'◡'●) .

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Github:- https://github.com/kunal-attri

Like And Subscribe our Channel.......