Installing Newer Tor Versions

From Kicksecure
Jump to navigation Jump to search
Documentation Previous page: Kicksecure-Qubes Security Index page: Documentation Next page: Virtualization Platform Security Installing Newer Tor Versions

How-to: Install Newer Versions of Tor

Introduction

[edit]

Info Testers only.

Note that a later Tor version will not always be installed from either:

  • A) Install Tor from Backports, or
  • B) The Tor Project APT repository -- in the recent past, the Debian bullseye repositories for packages.debian.org and deb.torproject.org had identical Tor versions. In general, as the Debian stable release ages, the likelihood of receiving a newer Tor version from deb.torproject.org increases.

The Tor Project APT Repository

[edit]

Info If the latest Tor version from deb.torproject.org has not been fully tested by Kicksecure developers at a specific point in time, then problems can emerge such as broken connectivity. [1] Testers should always maintain a separate, working version of Kicksecure so future connectivity problems can be averted.

If you wish to proceed despite the risk, two steps are required:

  • The deb.torproject.org repository must be enabled.
  • The anon-shared-build-apt-sources-tpoarchive.org iconarchive.today icon package must be installed, since it enables The Tor Project's APT signing key and installs the apt source torproject.sources [2]

1 In Kicksecure (kicksecure-18), update the package lists.

sudo apt update

2 Install the helper package that adds The Tor Project APT source and signing key.

sudo apt install anon-shared-build-apt-sources-tpo

3 Optional: switch to a different Tor Project distribution channel (for example, stable vs experimental).

Open file /etc/apt/sources.list.d/torproject.sources in an editor with administrative ("root") rights.

1 Select your platform.

Kicksecure

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/torproject.sources

Kicksecure-Qubes

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.
  • Template requirement: When using Kicksecure-Qubes, this must be done inside the Template.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/torproject.sources

4 Notes.

  • Shut down Template: After applying this change, shut down the Template.
  • Restart App Qubes: All App Qubes based on the Template need to be restarted if they were already running.
  • Qubes persistence: See also Qubes Persistence
  • General procedure: This is a general procedure required for Qubes and is unspecific to Kicksecure-Qubes.

Others and Alternatives

2 Notes.

  • Example only: This is just an example. Other tools could achieve the same goal.
  • Troubleshooting and alternatives: If this example does not work for you, or if you are not using Kicksecure, please refer to Open File with Root Rights.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/torproject.sources

Disable the https://deb.torproject.org/torproject.orgarchive.org iconarchive.today icon trixie main repository by finding the stanza with those settings, and changing Enabled: yes to Enabled: no in it. Then find the stanza for a different distributionarchive.org iconarchive.today icon, and enable it by changing that stanza's Enabled: no line to Enabled: yes.

Save the file.

4 Update the package lists so the new torproject.sources settings take effect. [3]

sudo apt update

5 Install Tor from The Tor Project repository (this may install a newer version).

This step also installs the deb.torproject.org-keyring package which keeps the Tor Project repository apt key up-to-date.

sudo apt install tor deb.torproject.org-keyring

Onionize Tor Project APT Repository

[edit]

Only follow these instructions if Newer Tor versions from The Tor Project Repository was configured. Note that The Tor Project deb apt signing key must be added first (see the prior link), or error messages will appear when completing these steps.

1 Open torproject.sources in a text editor.

Open file /etc/apt/sources.list.d/torproject.sources in an editor with administrative ("root") rights.

1 Select your platform.

Kicksecure

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/torproject.sources

Kicksecure-Qubes

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.
  • Template requirement: When using Kicksecure-Qubes, this must be done inside the Template.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/torproject.sources

4 Notes.

  • Shut down Template: After applying this change, shut down the Template.
  • Restart App Qubes: All App Qubes based on the Template need to be restarted if they were already running.
  • Qubes persistence: See also Qubes Persistence
  • General procedure: This is a general procedure required for Qubes and is unspecific to Kicksecure-Qubes.

Others and Alternatives

2 Notes.

  • Example only: This is just an example. Other tools could achieve the same goal.
  • Troubleshooting and alternatives: If this example does not work for you, or if you are not using Kicksecure, please refer to Open File with Root Rights.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/torproject.sources

2 Replace the clearnet repository with the onion repository by toggling Enabled:.

Disable the https://deb.torproject.org/torproject.orgarchive.org iconarchive.today icon repository, and enable the tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.orgonion icon repository.

#### ENABLED SOURCES #### Types: deb URIs: https://deb.torproject.org/torproject.org Suites: trixie Components: main Enabled: no # <<<<< change this line from "yes" to "no" Signed-By: /usr/share/keyrings/deb.torproject.org-keyring.gpg #### DISABLED BY DEFAULT SOURCES #### Types: deb-src URIs: https://deb.torproject.org/torproject.org Suites: trixie Components: main Enabled: no Signed-By: /usr/share/keyrings/deb.torproject.org-keyring.gpg Types: deb deb-src URIs: https://deb.torproject.org/torproject.org Suites: tor-experimental-trixie Components: main Enabled: no Signed-By: /usr/share/keyrings/deb.torproject.org-keyring.gpg Types: deb deb-src URIs: https://deb.torproject.org/torproject.org Suites: tor-nightly-main-trixie Components: main Enabled: no Signed-By: /usr/share/keyrings/deb.torproject.org-keyring.gpg Types: deb deb-src # <<<<< Optional: Remove 'deb-src' from this line to save network bandwidth URIs: tor+http://apow7mjfryruh65chtdydfmqfpj5btws7nbocgtaovhvezgccyjazpqd.onion/torproject.org Suites: trixie Components: main Enabled: yes # <<<<< change this line from "no" to "yes" Signed-By: /usr/share/keyrings/deb.torproject.org-keyring.gpg

3 Update the package lists so the modified torproject.sources takes effect. [4]

sudo apt update

Install Tor from Backports

[edit]

This can be an alternative to Tor installation from The Tor Project's APT Repository, which is documented above.

tor can be installed from Debian backports. This is non-ideal; see the footnote. [5]

1 Boot Kicksecure (kicksecure-18) Template.

2 Add the current Debian stable backports codename trixie-backports to Debian apt sources.

Note: this applies to Kicksecure 18.0.8.7. Later Kicksecure versions may use a codename different from trixie.

In Kicksecure (kicksecure-18) Template, run.

sudo su -c "echo -e 'Types: deb URIs: tor+https://deb.debian.org/debian Suites: trixie-backports Components: main contrib non-free Enabled: yes Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg' > /etc/apt/sources.list.d/backports.sources"

Alternatively, users who like Onionizing Repositories can set the .onion mirror.

sudo su -c "echo -e 'Types: deb URIs: tor+http://2s4yqjx5ul6okpp3f2gaunr2syex5jgbfpfvhxxbbjwnrsvbk5v3qbid.onion/debian Suites: trixie-backports Components: main contrib non-free Enabled: yes Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg' > /etc/apt/sources.list.d/backports.sources"

3 Update the package lists.

sudo apt update

4 Install the selected software.

sudo apt -t trixie-backports install tor

The procedure is now complete.

5 Undo.

On occasion it is necessary to undo this configuration, for example when upgrading from Debian trixie to forky. [6] To proceed, run.

sudo rm /etc/apt/sources.list.d/backports.sources

Install Tor from Source Code

[edit]

Advanced users only!

All steps should be performed inside Kicksecure (kicksecure).

1 Add the Debian sources file so source repositories can be enabled.

Open file /etc/apt/sources.list.d/debian.sources in an editor with administrative ("root") rights.

1 Select your platform.

Kicksecure

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/debian.sources

Kicksecure-Qubes

2 Notes.

  • Sudoedit guidance: See Open File with Root Rights for details on why using sudoedit improves security and how to use it.
  • Editor requirement: Close Featherpad (or the chosen text editor) before running the sudoedit command.
  • Template requirement: When using Kicksecure-Qubes, this must be done inside the Template.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/debian.sources

4 Notes.

  • Shut down Template: After applying this change, shut down the Template.
  • Restart App Qubes: All App Qubes based on the Template need to be restarted if they were already running.
  • Qubes persistence: See also Qubes Persistence
  • General procedure: This is a general procedure required for Qubes and is unspecific to Kicksecure-Qubes.

Others and Alternatives

2 Notes.

  • Example only: This is just an example. Other tools could achieve the same goal.
  • Troubleshooting and alternatives: If this example does not work for you, or if you are not using Kicksecure, please refer to Open File with Root Rights.

3 Open the file with root rights.

sudoedit /etc/apt/sources.list.d/debian.sources

2 Enable the deb-src repositories required to fetch Tor source and build dependencies.

Find the deb-src stanzas in this file. Enable either those that contain torified HTTPS addresses or those that contain onion addresses. To enable a repository, change the line Enabled: no in the repository's stanza to Enabled: yes.

3 Update the package lists after enabling source repositories.

sudo apt update

4 Install build dependencies for Tor.

sudo apt build-dep tor

5 Fetch the Tor release signing key so the source archive signature can be verified. [7]

Whonix first time users warning Warning:

The following command using gpg with --recv-keys is not recommended for security reasons and is often non-functional. [8] This is not a Kicksecure-specific issue. The OpenPGP public key should be downloaded from the web instead; see also Secure Downloads. This procedure is currently undocumented and can be resolved as per the Self Support First Policy. Documentation contributions will be happily considered.

gpg --keyserver keys.openpgp.org --recv-keys 7A02B3521DC75C542BA015456AFEE6D49E92B601

If the attempt fails, utilize the v3 onion service instead.

gpg --keyserver zkaan2xfbuxia2wpf7ofnkbz6r5zdbbvxbunvp5g2iebopbfc4iqmbad.onion --recv-keys 7A02B3521DC75C542BA015456AFEE6D49E92B601

6 Download the Tor source code archive for the desired version.

Note: Replace Tor version 0.4.6.5 with the actual Tor version to be downloaded.

scurl-download https://dist.torproject.org/tor-0.4.6.5.tar.gz

7 Download the OpenPGP signature and verify the source archive.

scurl-download https://dist.torproject.org/tor-0.4.6.5.tar.gz.asc

gpg --verify tor-0.4.6.5.tar.gz.asc

The output should look similar to the following.

gpg: assuming signed data in 'tor-0.4.6.5.tar.gz'

gpg: Signature made Mon 09 Dec 2019 06:21:51 PM UTC gpg: using RSA key 7A02B3521DC75C542BA015456AFEE6D49E92B601 gpg: Good signature from "Nick Mathewson <nickm@alum.mit.edu>" [unknown] gpg: aka "Nick Mathewson <nickm@wangafu.net>" [unknown] gpg: aka "Nick Mathewson <nickm@freehaven.net>" [unknown] gpg: aka "Nick Mathewson <nickm@torproject.org>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 2133 BC60 0AB1 33E1 D826 D173 FE43 009C 4607 B1FB

Subkey fingerprint: 7A02 B352 1DC7 5C54 2BA0 1545 6AFE E6D4 9E92 B601

8 Extract the source archive.

tar xvzf tor-0.4.6.5.tar.gz

9 Change into the extracted source directory.

cd tor-0.4.6.5/

10 Configure the build and compile Tor from source.

./configure

make

The build should now be finished.

11 Verify the version of the newly built Tor binary.

./src/app/tor --version

The output should show.

Tor version 0.4.6.5.

12 Kicksecure for Qubes only: copy the newly built binary into the Kicksecure Template (whonix-gw-18).

qvm-copy ./src/app/tor

13 Stop the currently running Tor service before replacing the binary.

sudo systemctl stop tor

14 Replace the system Tor binary with the newly built binary.

sudo cp ./src/app/tor /usr/sbin/tor

Copy the binary again. [9]

sudo cp ./src/app/tor /usr/bin/tor

15 Start Tor again to apply the new binary.

sudo systemctl start tor

The process of installing Tor from source code is now complete.

Tor Version Downgrade

[edit]

It is usually not required to downgrade the Tor version. This should be used only in very specific cases to work around a bug or for testing.

1 Platform specific notice.

  • non-Qubes users: No special notice.
  • Qubes users: In Template.

2 Show available Tor versions.

apt list tor -a

3 Downgrade, for example, to Tor version 0.4.7.16-1.

Note: The version number was appropriate at the time of writing but might need replacement in the future.

sudo apt install tor=0.4.7.16-1 tor-geoipdb=0.4.7.16-1

4 Platform specific notice.

  • non-Qubes users: No special notice.
  • Qubes users: Shut down Template.

5 Reboot.

A reboot of the (VM) running Tor is required.

6 Done.

The Tor version downgrade process has been completed.

Footnotes

[edit]
  1. At the time of writing Tor v4.2.5 was non-functional in Kicksecure.
  2. Alternatively, The Tor Project's native instructions for Debianarchive.org iconarchive.today icon can be used, but the manual steps are more difficult and involved. The verification of The Tor Project APT signing key is also harder. Since you already trust Kicksecure, the logical choice is to trust another Kicksecure package to install the right signing key.
  3. So the newly installed /etc/apt/sources.list.d/torproject.sources takes effect.
  4. So the modified /etc/apt/sources.list.d/torproject.sources takes effect.
  5. Users should Prefer Packages from Debian Stable Repository, but using backports is better than manual software installation or using third party package managers since this prefers APT. To contain the risk,
  6. Most often this step applies before attempting major Kicksecure upgrades; upgrade instructions are also made available at that time (see Stay Tuned).
  7. https://forums.whonix.org/t/gpg-recv-keys-fails-no-longer-use-keyservers-for-anything/5607archive.org iconarchive.today icon
  8. apt-file list tor shows both locations /usr/bin/tor and /usr/sbin/tor.

Documentation Previous page: Kicksecure-Qubes Security Index page: Documentation Next page: Virtualization Platform Security

Notification image

We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 13 year success story and maybe DONATE!