Actions

Template

Build Documentation apt-cache

From Whonix

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.

torified apt-cacher-ng

The following torified apt-cacher-ng setup only has to be applied, if you are building using onion apt sources using --connection onion.

However, if you are building behind a Tor transparent proxy such as Whonix-Gateway ™, you can use the simpler clearnet apt-cacher-ng instructions below instead.

Ambox notice.png If you skip these steps of setting up a torified apt-cacher-ng, you must below drop and not use REPO_PROXY=http://127.0.0.1:3142.

Ambox warning pn.svg.png 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 /lib/systemd/system/apt-cacher-ng.service.d.

sudo mkdir -p /lib/systemd/system/apt-cacher-ng.service.d

Open file /lib/systemd/system/apt-cacher-ng.service.d/50_user.conf in an editor with root rights.

(Qubes-Whonix ™: In TemplateVM)

This box uses sudoedit for better security. This is an example. Other tools could archive the same goal too. If this example does not work for you or if you are not using Whonix, please see this link.

sudoedit /lib/systemd/system/apt-cacher-ng.service.d/50_user.conf

Add.

[Service]
ExecStart=torsocks /usr/sbin/apt-cacher-ng SocketPath=/run/apt-cacher-ng/socket -c /etc/apt-cacher-ng ForeGround=1

Save.

Reload systemd.

sudo systemctl daemon-reload

Restart apt-cacher-ng.

sudo systemctl apt-cacher-ng restart

clearnet apt-cacher-ng

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.

Prepend REPO_PROXY=http://127.0.0.1:3142 before the build command.

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.

From 14.0.1.0.7-developers-only and above Whonix automatically uses apt-cacher-ng.


[advertisement] Looking to Sell Your Company? Contact me.


Have you read our Documentation, Technical Design and Developer Portal links yet?

https | (forcing) onion
Follow: Twitter.png Facebook.png 1280px-Gab text logo.svg.png Rss.png 1024px-Telegram 2019 Logo.svg.png

Share: Twitter | Facebook

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation.

Copyright (C) 2012 - 2019 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee of the Open Invention Network. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)

Whonix ™ is a derivative of and not affiliated with Debian. Debian is a registered trademark owned by Software in the Public Interest, Inc.

Whonix ™ is produced independently from the Tor® anonymity software and carries no guarantee from The Tor Project about quality, suitability or anything else.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint.