{{Header}}
{{title|title=
Onionizing Repositories
}}
{{#seo:
|description=The guide explains how to configure Tor onion services for APT repositories to enhance security and privacy, but it may cause system updates to fail due to unreliability. The configuration provides protection against targeted and man-in-the-middle attacks, and prevents tracking of installed programs.
|image=Onionrepository23234.jpg
}}
[[File:Onionrepository23234.jpg|thumb]]
{{intro|
The guide explains how to configure experimental Tor onion services for APT repositories. The configuration provides additional security and privacy benefits, such as protection against targeted attacks, man-in-the-middle attacks, and preventing tracking of installed programs, but it may cause system updates to fail due to unreliability.
}}
= Introduction =
When software packages from Debian or {{project_name_long}} repositories are downloaded, prior to the installation of new packages or upgrades, the package repository sources default to the https transport protocol, which is [[SSL|non-ideal for security]]. Instead, experimental Tor onion services can be configured, which provides several security and privacy benefits: [https://blog.torproject.org/blog/tor-heart-apt-transport-tor-and-debian-onions]
* 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, cannot 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.
Be aware that enabling onion repositories may cause system updates to periodically fail due to their [https://forums.whonix.org/t/disable-onions-by-default-due-to-unreliability/6650 unreliability]. If this becomes an issue, it is encouraged to [[Operating_System_Software_and_Updates#Non-functional_Onion_Services|Re-enable Clearnet Repositories]] so packages can be updated.
If the term "comment" is unfamiliar, please follow [https://www.howtogeek.com/118389/how-to-comment-out-and-uncomment-lines-in-a-configuration-file/ this link] to learn how to comment / uncomment lines in a configuration file.
On this page, instructions are provided for onionizing sources on the [[#Debian|Debian]], [[#{{project_name_short}}|{{project_name_short}}]] APT sources.
= Onionize Debian Package Sources =
{{Box|text=
'''1.''' {{Open with root rights|filename=
/etc/apt/sources.list.d/debian.sources
}}
'''2.''' Enable the onionized Debian repositories and disable the clearnet repositories.
Enable the following .onion mirrors and disable the corresponding https repositories (except the fasttrack repository).
{{CodeSelect|code=
######## ENABLED SOURCES ########
Types: deb
URIs: tor+https://deb.debian.org/debian
Suites: trixie trixie-updates trixie-backports
Components: main contrib non-free non-free-firmware
Enabled: no # <<<<< change this line from "yes" to "no"
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
URIs: tor+https://deb.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Enabled: no # <<<<< change this line from "yes" to "no"
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
URIs: tor+https://fasttrack.debian.net/debian-fasttrack
Suites: trixie-fasttrack trixie-backports-staging
Components: main contrib non-free
Enabled: yes # <<<<< keep this line saying "yes"
Signed-By: /usr/share/keyrings/fasttrack-archive-keyring.gpg
######## DISABLED BY DEFAULT SOURCES ########
#### deb ####
Types: deb
URIs: tor+http://2s4yqjx5ul6okpp3f2gaunr2syex5jgbfpfvhxxbbjwnrsvbk5v3qbid.onion/debian
Suites: trixie trixie-updates trixie-backports
Components: main contrib non-free non-free-firmware
Enabled: yes # <<<<< change this line from "no" to "yes"
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
URIs: tor+http://5ajw6aqf3ep7sijnscdzw77t7xq4xjpsy335yb2wiwgouo7yfxtjlmid.onion/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Enabled: yes # <<<<< change this line from "no" to "yes"
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
## No onion for fasttrack yet: https://salsa.debian.org/fasttrack-team/support/-/issues/27
}}
'''3.''' Save and exit.
}}
= Onionize {{project_name_short}} APT Sources =
Follow these steps to point the {{project_name_short}} sources file to the onion mirror. See [[Project-APT-Repository|{{project_name_short}} APT Repository overview]] for details on the four repository choices.
This can be done using repository-dist {{cli}} tool with the --transport onion option.
{{Box|text=
'''1.''' Run the following command:
{{CodeSelect|code=
sudo repository-dist --enable --transport onion
}}
'''2.''' Confirm the onionized repository is functional.
{{CodeSelect|code=
upgrade-nonroot
}}
}}
= Onionize Tor Project APT Sources =
For enhanced security, advanced users and testers can onionize Tor Project updates; see [[Tor_Versioning|Tor Versioning]] for further details.
= Qubes =
* https://forum.qubes-os.org/t/qubes-dom0-update-fails-to-detect-release-version-on-all-operations/6729/16
* https://forum.qubes-os.org/t/onion-mirror-for-qubes-templates-itl-not-serving-debian-13-even-though-present-was-qvm-template-confusion/37358
= Footnotes =
{{reflist|close=1}}
{{Footer}}
[[Category:Documentation]]