Debian 仓库

Yes, deb.torproject.org is also served via an Onion Service: http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/

如需使用 Apt over Tor(通过 Tor 网络的 apt),需要安装 apt transport 工具:

sudo apt install apt-transport-tor -y

Then you need to add the repository:

For the stable version:

printf "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/tor-project-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org $(lsb_release -c) main" | sudo tee -a /etc/apt/sources.list.d/tor-project.list
printf "deb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/tor-project-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org $(lsb_release -c) main" | sudo tee -a /etc/apt/sources.list.d/tor-project.list

For the experimental builds: printf "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/tor-project-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org tor-experimental-$(lsb_release -c) main" | sudo tee -a /etc/apt/sources.list.d/tor-project.list printf "deb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/tor-project-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org tor-experimental-$(lsb_release -c) main" | sudo tee -a /etc/apt/sources.list.d/tor-project.list


For the nightly builds:

printf "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/tor-project-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org tor-nightly-main-$(lsb_release -c) main" | sudo tee -a /etc/apt/sources.list.d/tor-project.list printf "deb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/tor-project-keyring.gpg] tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org tor-nightly-main-$(lsb_release -c) main" | sudo tee -a /etc/apt/sources.list.d/tor-project.list


Since Debian 12 bookworm you can also use the more modern deb822-style:

echo -e "Types: deb deb-src\nComponents: main\nSuites: bookworm\nURIs: tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org\nArchitectures: amd64 arm64 i386\nSigned-By: /usr/share/keyrings/tor-project-keyring.gpg" | sudo tee /etc/apt/sources.list.d/tor-project.sources ```

Tor Project 维护着它自己的 Debian 软件包存储库。由于 Debian 提供 Tor 的 LTS 版本,这可能并不是最新稳定的 Tor 版本。因此,我们建议你从我们的软件包存储库中安装 Tor

在基于 Debian 的系统中,如何添加 Tor 软件包仓库?请查看以下指示:

注意:符号#表示以 root 身份运行代码。这意味着您应该有权访问具有系统管理权限的用户帐户,即您的用户应该在 sudo 组中。

前提:验证 CPU 架构

该软件包库提供 amd64arm64i386 二进制文件。通过检查以下命令的输出,确认你的操作系统能够运行该二进制文件:

  # dpkg --print-architecture

输出应是 amd64arm64i386。存储库不支持其他 CPU 架构。

注意: 该软件包库不提供 32 位 ARM 架构(armhf) 的镜像(目前还没有)。你应该安装 Debian 提供的版本(确保查看 Debian backports,因为该版本通常有很多较新的 Tor 软件包),或者从源代码生成 Tor

1. 安装 apt-transport-https

使所有使用 libapt-pkg 库的软件包管理器通过 https(安全超文本传输协议)访问的源中提供的元数据和软件包。

   # apt install apt-transport-https

2. 在/etc/apt/sources.list.d/ 中创建新文件并命名为tor.list。添加下列条目:

   deb     [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org <DISTRIBUTION> main
   deb-src [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org <DISTRIBUTION> main

如果你想尝试 experimental 软件包,请在上面几行另外添加:

   deb     [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org tor-experimental-<DISTRIBUTION> main
   deb-src [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org tor-experimental-<DISTRIBUTION> main

或 nightly build 版本:

   deb     [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org tor-nightly-main-<DISTRIBUTION> main
   deb-src [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org tor-nightly-main-<DISTRIBUTION> main

用操作系统代号替换 <DISTRIBUTION> 。运行lsb_release -c 或者cat /etc/debian_version查看操作系统的版本。

注意: Ubuntu Focal 不再支持 32 位,因此应使用:

   deb     [arch=<ARCHITECTURE> signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org focal main
   deb-src [arch=<ARCHITECTURE> signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org focal main

<ARCHITECTURE>替换为你的系统架构(之前已用dpkg --print-architecture找到)。

运行 sudo apt update 时的警告信息:

   Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://deb.torproject.org/torproject.org focal InRelease' doesn't support architecture 'i386'

3. 在命令提示符下运行以下命令,添加用于签署软件包的 gpg 密钥:

   # wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/deb.torproject.org-keyring.gpg >/dev/null

4. 安装 tor 和 tor debian 密钥环

推荐使用我们提供的 Debian 软件包,以便保持签名密钥为最新。请使用以下命令安装:

   # apt update
   # apt install tor deb.torproject.org-keyring

不可以。 请勿使用来自 Ubuntu 的 universe 软件包。 过去它们一直没有进行可靠的更新。这意味着你可能错过稳定性和安全性的修复。 请使用 Tor Debian 存储库