警告: 這些說明適用於安裝tor網路守護程式,即little-t-tor. 有關安裝Tor 瀏覽器橋接中繼站的資訊,請參考洋蔥路由瀏覽器使用手冊

需要管理員權限:要安裝 Tor,您需要 root 權限。 下面所有指令需要有 root 權限執行(如 apt 和 dpkg)其帶有“#”前綴,而以用戶身份運行的指令則帶有“$”,類似於終端機標準提示符。 要打開 root 終端有多種選擇:sudo su、sudo -i 或 su -i。 請注意,sudo 會要求提供用戶密碼,而 su 需要系統的 root 密碼。

Debian / Ubuntu

千萬別使用Ubuntu官方universe套件庫裡的版本。 過去它們沒有可靠的更新,此意謂著欠缺隱定性與安全補丁。

  • Configure Tor package repository

Enable the Tor Project APT repository by following the instructions.

  • 套件安裝

# apt install tor

Fedora

  • Configure Tor Package repository

Enable the Tor Project's RPM package repository by following the instructions.

  • 套件安裝

# dnf install tor

FreeBSD

  • 套件安裝

# pkg install tor

OpenBSD

  • 套件安裝

# pkg_add tor

macOS版

  • 安裝一個套件管理器

OS X 有二種套件管理器: Homebrew 與 Macports。 您可使用所選的套件管理器。

安裝 Homebrew 請依 brew.sh 指示。

安裝 Macports 請照 macports.org/install.php 指示。

  • 套件安裝

如果使用 Homebrew 請在終端視窗執行:

# brew install tor

如果使用 Macports 請在終端視窗執行:

$ sudo port install tor

Arch Linux

  • 在 Arch Linux 上安裝 tor 套件,執行:
# pacman -Syu tor

DragonFlyBSD

  • Bootstrap pkg

DragonFlyBSD's daily snapshots and releases (starting with 3.4) come with pkg already installed. Upgrades from earlier releases, however, will not have it. If pkg is missing on the system for any reason, it can be quickly bootstrapped without having to build it from source or even having DPorts installed:

# cd /usr
# make pkg-bootstrap
# rehash
# pkg-static install -y pkg
# rehash
  • 設定 pkg 的推薦步驟

Here, it will be similar to what we have on a FreeBSD system, and we are going to use HTTPS to fetch our packages, and updates - so here we also need an extra package to help us out (ca_root_nss).

正在安裝ca_root_nss組件:

# pkg install ca_root_nss

For fresh installations, the file /usr/local/etc/pkg/repos/df-latest.conf.sample is copied to /usr/local/etc/pkg/repos/df-latest. The files ending in the ".sample" extension are ignored; pkg(8) only reads files that end in ".conf" and it will read as many as it finds.

DragonflyBSD 有兩個套件儲存庫:

  • Avalon (mirror-master.dragonflybsd.org);
  • Wolfpond (pkg.wolfpond.org).

We can simply edit the URL used to point out the repositories on /usr/local/etc/pkg/repos/df-latest and that's it! Remember to use pkg+https:// for Avalon.

在確認這些所有的變更後,我們再次更新軟體包列表,並嘗試檢查是否已經有新的更新要套用:

# pkg update -f
# pkg upgrade -y -f
  • 套件安裝

安裝tor組件:

# pkg install tor

NetBSD

  • 設定pkg_add

目前版本的 NetBSD 作業系統可以設定為使用pkgin,這是一款致力在像aptyum一樣用於管理 pkgsrc 二進位套件的軟體。我們不會在這裡討論它的設置,而是選擇使用預設的pkg_add

# echo "PKG_PATH=http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$(uname -m)/$(uname -r)/All" > /etc/pkg_install.conf
  • 套件安裝

安裝torNetBSD的組件:

# pkg_add tor

Void Linux

To install the tor package on Void Linux, please run:

# xbps-install -S tor

正在從來源安裝Tor

  • Download latest release and dependencies

最新的 Tor 發行版本可以在 下載頁面找到。

如果是從源代碼建置,請先安裝 libevent並確認已有 openssl 與 zlib (包括適用的 -devel 套件)。

  • 安裝 Tor

    tar -xzf tor-0.4.3.6.tar.gz; cd tor-0.4.3.6

    ./configure && make

現在你可以執行tor作為 src/app/tor(0.4.3.x 或更新),或者你也可以執行make install(如有必要,請用 root 身分) 來將其安裝在/usr/local/,然後你就可以透過執行 tor 來啟動它。