docs/en/debian.wml
2a9aaa80
 ## translation metadata
40e07e2e
 # Revision: $Revision$
2a9aaa80
 # Translation-Priority: 3-low
 
 #include "head.wmi" TITLE="Tor Project: Debian/Ubuntu Instructions" CHARSET="UTF-8"
3e230b9e
 {#meta#:
 <script type="text/javascript" src="debian-selector.js"></script>
 :#meta#}
6bfcba96
 
2a9aaa80
 <div id="content" class="clearfix">
   <div id="breadcrumbs">
b289ef06
     <a href="<page index>">Home &raquo; </a>
2a9aaa80
     <a href="<page docs/documentation>">Documentation &raquo; </a>
     <a href="<page docs/debian>">Debian/Ubuntu Instructions</a>
   </div>
529218b3
   <div id="maincol">
c22b7380
 <a id="debian"></a>
37f37e9a
 <h2><a class="anchor" href="#debian">Option one: Tor on Debian Stretch - stable,
 Debian Buster - testing, or Debian Sid - unstable</a></h2>
c22b7380
 <br />
 
 <p>
6bfcba96
 If you're using Debian, just run
63b0a94e
 </blockquote><pre>  apt install tor </pre></blockquote>
c22b7380
 as root.
 </p>
 
d0fc61a2
 <p>Debian provides the <a href="https://packages.debian.org/stretch/tor">LTS</a>
 version of Tor. Note that this might not always give you the latest stable
 Tor version, but you will receive important security fixes. To make sure
 that you're running the latest stable version of Tor, see option two below.
c22b7380
 </p>
 
 <p>
 Now Tor is installed and running. Move on to <a href="<page
2736971f
 docs/tor-doc-unix>#using">step two</a> of the "Tor on Linux/Unix"
c22b7380
 instructions.
 </p>
 
 <hr />
 
 <a id="ubuntu"></a>
 <a id="packages"></a>
 <h2><a class="anchor" href="#ubuntu">Option two: Tor on Ubuntu or
 Debian</a></h2>
 <br />
 
 <p>
ad472e85
 <b>Do not use the packages in Ubuntu's universe.</b> In the past they have
 not reliably been updated. That means you could be missing stability
 and security fixes.
c22b7380
 </p>
 
529218b3
 <p>
f272d489
 <b>Raspbian is not Debian.</b> Tor might run fine on the Raspberry Pi 2 / 3 but not the first generation Pi.
 These packages might be confusingly broken for Raspbian users, since Raspbian called their architecture armhf but
61a4bb18
 Debian already has an armhf. See <a
 href="http://tor.stackexchange.com/questions/242/how-to-run-tor-on-raspbian-on-the-raspberry-pi">this
 post</a> for details.
529218b3
 </p>
 
c22b7380
 <p>
 You'll need to set up our package repository before you can fetch
3047321b
 Tor. First, you need to figure out the name of your distribution. A
74a3475b
 quick command to run is <tt>lsb_release -c</tt> or <tt>cat /etc/debian_version</tt>.
09ab345a
 If in doubt about your Debian version, check <a href="https://www.debian.org/releases/">the Debian website</a>.
363e2bcd
 For Ubuntu, ask <a href="https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Table_of_versions">Wikipedia</a>.
6bfcba96
 </p>
 
 <div id="selector" style="display: none;">
 <blockquote>
186abc67
 I run
d4e1a357
 <select id="distrib">
d48f0047
 <option value="jessie">Debian oldstable (jessie)</option>
 <option value="stretch" selected="selected">Debian stable (stretch)</option>
2017af4f
 <option value="buster">Debian testing (buster)</option>
44cb1888
 <option value="sid">Debian unstable (sid)</option>
731144db
 <option value="trusty">Ubuntu Trusty Tahr (14.04 LTS)</option>
 <option value="xenial">Ubuntu Xenial Xerus (16.04 LTS)</option>
 <option value="artful">Ubuntu Artful Aardvark (17.10)</option>
eef9993f
 <option value="bionic">Ubuntu Bionic Beaver (18.04 LTS)</option>
6bfcba96
 </select>
186abc67
 and want
d4e1a357
 <select id="package"></select>
6bfcba96
 version
d4e1a357
 <select id="version"></select>
6bfcba96
 </blockquote>
 
 
 <div id="apt-source">
 <p>You need to add the following entry in <code>/etc/apt/sources.list</code> or a new file in <code>/etc/apt/sources.list.d/</code>:</p>
 
7bf85595
 <blockquote><pre id="sources">deb https://deb.torproject.org/torproject.org jessie main
6bfcba96
 </pre></blockquote>
 </div>
c22b7380
 
4fcb5df5
 <p>Please note that the <a href="https://packages.debian.org/stretch/apt-transport-https">apt-transport-https package</a> is required to enable the usage of 'deb https://foo distro main' lines in the /etc/apt/sources.list so that all package managers using the libapt-pkg library can access metadata and packages available in sources accessible over https (Hypertext Transfer Protocol Secure).</p>
09ab345a
 
6bfcba96
 <div id="sig">
 <p>Then add the gpg key used to sign the packages by running the following commands at your command prompt:</p>
 <blockquote><pre>
1786a167
 gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
6bfcba96
 gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
 </pre></blockquote>
 </div>
 
 
 <div id="apt-get">
 <p>You can install it with the following commands:</p>
63b0a94e
 <blockquote><pre>$ apt update
 <span id="regular-install">$ apt install <span id="apt-package">tor</span> deb.torproject.org-keyring</span>
 <span id="source-install">$ apt install build-essential fakeroot devscripts
 $ apt build-dep tor deb.torproject.org-keyring</span></pre></blockquote>
6bfcba96
 
 <div id="source-install2">
 <p>
 Then you can build Tor in ~/debian-packages:
 </p>
 <blockquote><pre>
 $ mkdir ~/debian-packages; cd ~/debian-packages
63b0a94e
 $ apt source tor
6bfcba96
 $ cd tor-*
 $ debuild -rfakeroot -uc -us
 $ cd ..
 </pre></blockquote>
 <p>Now you can install the new package:</p>
 <blockquote><pre>
 $ sudo dpkg -i tor_*.deb
 </pre></blockquote>
 </div>
 </div>
 </div>
 
 <noscript>
 <p>
c22b7380
 Then add this line to your
 <tt>/etc/apt/sources.list</tt>
 file:<br />
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
0f3c0995
 deb     https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
c22b7380
 </pre>
fc4589a3
 where you put the codename of your distribution (i.e. stretch, buster, sid
 or whatever it is)
3047321b
 in place of &lt;DISTRIBUTION&gt;.
c22b7380
 </p>
 
 <p>
 Then add the gpg key used to sign the packages by running the following
 commands at your command prompt:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
1786a167
 gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
c22b7380
 gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
 </pre>
af46839e
 Now refresh your sources, running the following command (as root) at your
 command prompt:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
63b0a94e
 apt update
af46839e
 </pre>
 If there are no errors you're good to continue.
 </p>
 
 <p>
 We provide a Debian package to help you keep our signing key current.  It is
 recommended you use it.  Install it using
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
63b0a94e
 apt install deb.torproject.org-keyring
af46839e
 </pre>
 </p>
 
 <p>
 To finally install Tor just run:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
63b0a94e
 apt install tor
c22b7380
 </pre>
 </p>
 
6bfcba96
 </noscript>
 
c22b7380
 <p>
 Now Tor is installed and running. Move on to <a href="<page
2736971f
 docs/tor-doc-unix>#using">step two</a> of the "Tor on Linux/Unix"
c22b7380
 instructions.
 </p>
 
6bfcba96
 <noscript>
c22b7380
 <p style="font-size: small">
 The DNS name <code>deb.torproject.org</code> is actually a set of independent
 servers in a DNS round robin configuration.  If you for some reason cannot
 access it you might try to use the name of one of its part instead.  Try
 <code>deb-master.torproject.org</code>,
 <code>mirror.netcologne.de</code> or
 <code>tor.mirror.youam.de</code>.
 </p>
 
48f7789d
 <p><code>deb.torproject.org</code> is also served through now also served via onion service:
 <a href="http://sdscoq7snqtznauu.onion">http://sdscoq7snqtznauu.onion/</a>.
ff3ad58c
 <br />
48f7789d
 See <a href="https://onion.torproject.org/">https://onion.torproject.org</a> for all
ff3ad58c
 torproject.org onion addresses.</p>
 
c22b7380
 <hr />
 
 <a id="development"></a>
 <h2><a class="anchor" href="#development">Option three: Using the
 development branch of Tor on Debian or Ubuntu</a></h2>
 <br />
 
3047321b
 <p>If you want to use the <a href="<page
58766943
 download/download-unix>#packagediff">development branch</a> of Tor instead
3047321b
 (more features and more bugs), you need to add a different set of lines
 to your <tt>/etc/apt/sources.list</tt> file:<br />
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
0f3c0995
 deb     https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
 deb     https://deb.torproject.org/torproject.org tor-experimental-0.3.3.x-&lt;DISTRIBUTION&gt; main
c22b7380
 </pre>
fc4589a3
 where you again substitute the name of your distro (stretch, buster,
 sid, xenial, ...) in place of
3047321b
 &lt;DISTRIBUTION&gt;.
c22b7380
 </p>
 
 <p>
 Then run the following commands at your command prompt:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
c43fc080
 gpg --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
c22b7380
 gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
63b0a94e
 apt update
 apt install tor deb.torproject.org-keyring
c22b7380
 </pre>
 </p>
 
 <p>
 Now Tor is installed and running. Move on to <a href="<page
2736971f
 docs/tor-doc-unix>#using">step two</a> of the "Tor on Linux/Unix"
c22b7380
 instructions.
 </p>
 
 <hr />
 
 <a id="source"></a>
 <h2><a class="anchor" href="#source">Building from source</a></h2>
 <br />
 
 <p>
 If you want to build your own debs from source you must first add an
 appropriate <tt>deb-src</tt> line to <tt>sources.list</tt>.
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
c22b7380
 # For the stable version.
0f3c0995
 deb-src https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
c22b7380
 
 # For the unstable version.
0f3c0995
 deb-src https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
 deb-src https://deb.torproject.org/torproject.org tor-experimental-0.3.3.x-&lt;DISTRIBUTION&gt; main
c22b7380
 </pre>
c88817f5
 Substitute the name of your distro (stretch, buster, sid, xenial, ...) in place of &lt;DISTRIBUTION&gt;. Now refresh your sources by running (as root):
9215766f
 <pre style="margin: 1.5em 0 1.5em 2em">
63b0a94e
 apt update
9215766f
 </pre>
37f37e9a
 You also need to install the necessary packages to build your own debs and the
c22b7380
 packages needed to build Tor:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
63b0a94e
 apt install build-essential fakeroot devscripts
 apt build-dep tor
c22b7380
 </pre>
 Then you can build Tor in ~/debian-packages:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
c22b7380
 mkdir ~/debian-packages; cd ~/debian-packages
63b0a94e
 apt source tor
c22b7380
 cd tor-*
 debuild -rfakeroot -uc -us
 cd ..
 </pre>
 Now you can install the new package:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
c22b7380
 sudo dpkg -i tor_*.deb
 </pre>
 </p>
 
 <p>
 Now Tor is installed and running. Move on to <a href="<page
2736971f
 docs/tor-doc-unix>#using">step two</a> of the "Tor on Linux/Unix"
c22b7380
 instructions.
 </p>
6bfcba96
 </noscript>
c22b7380
 
 <!-- END MAIN COL -->
2a9aaa80
   </div>
   <div id = "sidecol">
 #include "side.wmi"
 #include "info.wmi"
   </div>
   <!-- END SIDECOL -->
 </div>
 <!-- END CONTENT -->
37f37e9a
 #include <foot.wmi>