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

需要管理員權限:要安裝 Tor,您需要 root 權限。 Below all commands that need to be run as root user like apt and dpkg are prepended with '#', while commands to be run as user with '$' resembling the standard prompt in a terminal. To open a root terminal you have several options: sudo su, or sudo -i, or su -i. Note that sudo asks for your user password, while su expects the root password of your system.

Debian / Ubuntu

千萬別使用Ubuntu官方universe套件庫裡的版本。 In the past they have not reliably been updated. That means you could be missing stability and security fixes.

  1. Configure Tor package repository

Enable the Tor Project APT repository by following the instructions.

  1. 套件安裝

    # apt install tor

Fedora

  1. Configure Tor Package repository

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

  1. 套件安裝

    # dnf install tor

FreeBSD

  1. 套件安裝

    # pkg install tor

OpenBSD

  1. 套件安裝

    # pkg_add tor

macOS

  1. 安裝一個套件管理器

OS X 有二種套件管理器: Homebrew 與 Macports。 You can use the package manager of your choice.

安裝 Homebrew 請依 brew.sh 指示。

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

  1. 套件安裝

If you are using Homebrew in a Terminal window, run:

# brew install tor

If you are using Macports in a Terminal window, run:

$ sudo port install tor

Arch Linux

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

DragonFlyBSD

  1. 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

1.1 設定 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
  1. 套件安裝

安裝tor組件:

# pkg install tor

NetBSD

  1. 設定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
  1. 套件安裝

安裝torNetBSD的組件:

# pkg_add tor

Void Linux

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

# xbps-install -S tor

正在從來源安裝Tor

  1. Download latest release and dependencies

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

If you're building from source, first install libevent, and make sure you have openssl and zlib (including the -devel packages if applicable).

  1. 安裝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 來啟動它。