How to fetch Tor Debian packages over Tor
Learn how to configure Apt to use Tor, ensuring your package downloads from deb.torproject.org remain private and resistant to censorship.
The Tor Project maintains an official Debian package repository deb.torproject.org, which is also served through via an Onion Service: http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/
To use Apt over Tor, the apt transport needs to be installed:
$ sudo apt install apt-transport-tor
Then you need to add the following entries to /etc/apt/sources.list or a new file in /etc/apt/sources.list.d/:
# For the stable version.
deb [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org <DISTRIBUTION> main
# For the unstable version.
deb [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org tor-nightly-main-<DISTRIBUTION> main
Replace <DISTRIBUTION> with your Operating System codename. Run lsb_release -c or cat /etc/debian_version to check the Operating System version.
Since Debian bookworm you can also use the more modern deb822-style:
# echo "\
Types: deb deb-src
Components: main
Suites: bookworm
URIs: tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org
Architectures: amd64 arm64 i386
Signed-By: /usr/share/keyrings/deb.torproject.org-keyring.gpg
" | sudo tee /etc/apt/sources.list.d/tor.sources
For onion services run by the Debian project, please refer to their official documentation.