Template:Build Documentation apt-cache
Using an apt cache will greatly improve build speed when building several times in a row (e.g. when debugging, during development).
If you are interested, click on Expand on the right.
The following torified apt-cacher-ng setup only has to be applied, if you are building using onion apt sources using
--connection onion. In that case, please click Expand on the right. Howeverif you are building behind a Tor transparent proxy such as Whonix-Gateway, you can use the simpler clearnet apt-cacher-ng instructions below instead.
| If you skip these steps of setting up a torified apt-cacher-ng, you must below drop and not use
|Note, this neither torifies all of the build script's connections nor hides Tor from your ISP!|
Install apt-cacher-ng-, torsocks and tor.
sudo apt-get install apt-cacher-ng torsocks tor
Create folder apt-cacher-ng systemd drop-in folder
sudo mkdir -p /lib/systemd/system/apt-cacher-ng.service.d
Open /lib/systemd/system/apt-cacher-ng.service.d/50_user.conf in an editor with root rights.
[Service] ExecStart=torsocks /usr/sbin/apt-cacher-ng SocketPath=/run/apt-cacher-ng/socket -c /etc/apt-cacher-ng ForeGround=1
sudo systemctl daemon-reload
sudo systemctl apt-cacher-ng restart
sudo apt-get install apt-cacher-ng
Be sure to have a firewall, so the whole internet can not use the apt-cacher-ng service.
sudo REPO_PROXY=http://127.0.0.1:3142 ./whonix_build ...
When building inside a non-Whonix VM, an apt cache can be used on the host. In that case, adjust the IP accordingly and manually test that it is reachable. When building inside a (Whonix) VM, just install the apt cache inside the VM and point to a localhost apt cache.