I am currently using cellular connection most of the time. Thus, it is obvious that I prefer to reduce the amount of data transferred over the network.
Significant portion of it is reduced by the apt caching proxy apt-cacher-ng as I use Debian Linux distribution and VirtualBox on daily basis.
To install apt caching proxy execute the following command.
$ sudo apt-get install apt-cacher-ng
apt-cacher-ng service will start automatically and listen on the
Protect maintenance page
To protect maintenance page edit
/etc/apt-cacher-ng/security.conf configuration file to set username and password.
$ sudo vi /etc/apt-cacher-ng/security.conf
# This file contains confidential data and should be protected with file # permissions from being read by untrusted users. # # NOTE: permissions are fixated with dpkg-statoverride on Debian systems. # Read its manual page for details. # Basic authentication with username and password, required to # visit pages with administrative functionality. Format: username:password AdminAuth: administrator:secretpassword
Access maintenance page
Adjust application settings
/etc/apt-cacher-ng/acng.conf configuration file to define addresses/hostnames and port to listen on.
$ sudo vi /etc/apt-cacher-ng/acng.conf
[...] BindAddress: localhost 10.10.10.11 [...] Port:3142 [...]
Instruct APT to use recently configured proxy.
$ sudo vi /etc/apt/apt.conf.d/00proxy
To import already downloaded packages you need to perform the following steps.
$ sudo mkdir /var/cache/apt-cacher-ng/_import/
Copy or move downloaded packages to the directory created in the previous step.
$ sudo cp /var/cache/apt/archives/*.deb /var/cache/apt-cacher-ng/_import/
$ sudo chown -R apt-cacher-ng:apt-cacher-ng /var/cache/apt-cacher-ng/_import
Initiate import on the maintenance page.
apt-get updateaction on the machine using selected repository and apt cache proxy.
Customize HTML templates
To customize default web page edit
$ sudo vi /usr/lib/apt-cacher-ng/userinfo.html
To customize maintenance web page
$ sudo vi /usr/lib/apt-cacher-ng/report.html
Visit Apt-Cacher NG website to read user manual, mailing list or bug tracker.