Onionizing Repositories


When Whonix, Debian and Qubes packages are installed or updated, default settings point to repositories with a http:// URI. However, experimental Tor onion services are already available for the Whonix, Debian and Qubes packages.

There are several security and privacy benefits of using Tor onion services: [1]

  • The user cannot be uniquely targeted for malicious updates (attackers are forced to attack everyone requesting the update).
  • The package repository, or observers watching it, can't track what programs are installed.
  • The ISP cannot easily learn what packages are fetched.
  • End-to-end authentication and encryption provides protection against man-in-the-middle attacks (like version downgrade attacks).

Qubes Packages[edit]

The following commands must be run in dom0 in order to use Qubes’ Tor onion service repositories for each type of VM. [4]

The downside of this approach is that repository definitions are managed by a Qubes package, meaning manual updates are needed if the the definitions change in the future.


In dom0, run.

sudo sed -i 's/' /etc/yum.repos.d/qubes-dom0.repo && cat /etc/yum.repos.d/qubes-dom0.repo
sudo sed -i 's/' /etc/yum.repos.d/qubes-templates.repo && cat /etc/yum.repos.d/qubes-templates.repo

Fedora Template[edit]

In dom0, run.

qvm-run -a --nogui -p -u root <your_fedora_template> 'sed -i "s/" /etc/yum.repos.d/qubes-r* && cat /etc/yum.repos.d/qubes-r*'

Debian and Whonix Templates[edit]

In dom0, run.

qvm-run -a --nogui -p -u root <your_debian_template> 'sed -i "s/" /etc/apt/sources.list.d/qubes-r* && cat /etc/apt/sources.list.d/qubes-r*'

Whonix and Debian Packages[edit]

Until Whonix 14 is released, users may consider manually editing their sources.list to point to the Whonix and Debian .onion mirrors in order to install or update more securely.

The whonix.list and debian.list files in the /etc/apt/sources.list.d directory should be changed in both the Whonix-Workstation and Whonix-Gateway. Qubes-Whonix users note: Complete these steps in the whonix-gw and whonix-ws TemplateVMs.

1. Edit sources.list

In the Whonix-Gateway, edit the debian.list file using an editor with root rights.

If you are using a graphical Whonix or Qubes-Whonix, run.

kdesudo kwrite /etc/apt/sources.list.d/debian.list

If you are using a terminal-only Whonix, run.

sudo nano /etc/apt/sources.list.d/debian.list

2. Reference the Onionized Debian Repositories

Cut and paste the following .onion mirrors and comment out (#) the corresponding http repositories.

#deb jessie main contrib non-free
deb http://vwakviie2ienjx6t.onion/debian jessie main contrib non-free

#deb jessie/updates main contrib non-free
deb http://sgvtcaew4bxjd7ln.onion jessie/updates main contrib non-free

#Optional Backports
#deb jessie-backports main contrib non-free
deb http://vwakviie2ienjx6t.onion/debian jessie-backports main contrib non-free

Save and exit.

3. Reference the Onionized Whonix APT Repository

To use the v3 onion, run. [6]

sudo whonix_repository --baseuri http://deb.dds6qkxpwdeubwucdiaord2xgbbeyds25rbsgr73tbfpqpt4a6vjwsyd.onion --enable --repository stable

4. Confirm the Onionized Repositories are Functional

sudo apt-get update && sudo apt-get dist-upgrade

5. Repeat Steps 1 to 4 for the Whonix-Workstation

6. Optional: Onionize Tor Project Updates

Only complete this step if the Tor versions from The Tor Project repository are being used. The Tor Project deb apt signing key must be added first (see the link above), or the user will receive error messages when completing these steps.

The following commands are run in either the Whonix-Gateway or whonix-gw TemplateVM (for Qubes R3.2 users).

Note: Qubes-R4.0 TemplateVMs are non-network connected by default which will cause attempts to download the apt key in whonix-gw to fail.[7] To work around this issue users can fetch the Tor apt singing key from a (networked) anon-whonix AppVM. Then copy the key over to whonix-gw in a text file.

To add the Tor Project deb apt signing key, run. (In anon-whonix VM for Qubes-R4.0)

sudo apt-key adv --keyserver --recv-keys A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89

To display the keys fingerprint, run.

sudo apt-key adv --fingerprint A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89

Compare the fingerprint displayed in terminal with the one listed on this website

(Qubes-R4.0 only!) In anon-whonix, copy the Tor singing key to a new text file named tor.key

sudo apt-key export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 > /tmp/tor.key

(Qubes-R4.0 only!) In anon-whonix, copy the tor.key text file over to whonix-gw.

qvm-copy /tmp/tor.key whonix-gw

If the following error appears, it can be safely ignored (hit "OK" when prompted).

 qfile-agent: Fatal error: stat whonix-gw-version (error type: No such file or directory)

(Qubes-R4.0 only!) In whonix-gw, add the Tor signing key to the list of trusted keys.

sudo apt-key add ~/QubesIncoming/anon-whonix/tor.key

To onionize Tor Project updates first create a torproject.list file using an editor with root rights.

If you are using a graphical Whonix or Qubes-Whonix, run.

kdesudo kwrite /etc/apt/sources.list.d/torproject.list

If you are using a terminal-only Whonix, run.

sudo nano /etc/apt/sources.list.d/torproject.list

Next, cut and paste the following text and comment out (#) the corresponding http repository.

#Tor Project Mirror
#deb jessie main
deb http://sdscoq7snqtznauu.onion/ jessie main

Save and exit.


  3. Tor v3.2 or higher must be running in Whonix-Gateway (sys-whonix).
  4. The cat commands are optional and for confirmation only.
  6. Requires Tor v3.2 or above running in Whonix-Gateway (sys-whonix).

Random News:

Want to help create awesome, up-to-date screenshots for the Whonix wiki? Help is most welcome!

https | (forcing) onion

Share: Twitter | Facebook

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! See Conditions for Contributions to Whonix, then Edit! IP addresses are scrubbed, but editing over Tor is recommended. Edits are held for moderation.

Whonix is a licensee of the Open Invention Network. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Libre Software license as Whonix itself. (Why?)