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>
be786f13
 <h2><a class="anchor" href="#debian">Option one: Tor on Debian Stretch -
1e529dfd
 stable, Debian Buster - testing, or Debian Sid - unstable</a></h2>
c22b7380
 <br />
 
 <p>
4375e270
 If you're using Debian, just run as root:
1e529dfd
 <blockquote><pre># apt install tor</pre></blockquote>
c22b7380
 </p>
 
1e529dfd
 <p>Debian provides the
 <a href="https://packages.debian.org/stretch/tor">LTS</a>
d0fc61a2
 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>
be786f13
 When Tor is installed and running move on to
1e529dfd
 <a href="<page docs/tor-doc-unix>#using">step two</a> of the
 "<a href="<page docs/tor-doc-unix>">Tor on Linux/Unix</a>" instructions.
c22b7380
 </p>
 
 <hr />
 
 <a id="ubuntu"></a>
 <a id="packages"></a>
be786f13
 <h2><a class="anchor" href="#ubuntu">Option two: Tor on Ubuntu or
c22b7380
 Debian</a></h2>
 
 <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>
1e529dfd
 <b>Raspbian is not Debian.</b> Tor might run fine on the Raspberry Pi 2 / 3
 but not the first generation Pi.
be786f13
 These packages might be confusingly broken for Raspbian users, since Raspbian
1e529dfd
 called their architecture armhf but Debian already has an armhf. See <a
61a4bb18
 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>
1e529dfd
 <b>Admin access</b>:
 To install Tor you need root privileges. Below all commands that need to be run
 as root user like apt and dpkg are prepended with '&num;',
 while commands to be run as user with '$' resembling the standard
 prompt in a terminal. To open a root terminal you have several options:
 <code>sudo su</code>, or <code>sudo -i</code>,  or <code>su -i</code>.
 Note that sudo asks for your user password, while su expects
 the root password of your system.
 </p>
 
cb39c0a5
 <p>
 <b>GPG</b>:
 <a href="https://gnupg.org/">GNU Privacy Guard</a> version 2.1 is needed for
 this guide. If you are using an older version, consider upgrading to gnupg2
 or replace 'gpg2' below with <code>gpg --keyserver hkp://pool.sks-keyservers.net</code>
 since the keyserver option was mandatory for older versions.
 </p>
 
1e529dfd
 <p>
 <b>apt-transport-tor</b>:
 To use source lines with <tt>https://</tt> in <i>/etc/apt/sources.list</i> the
 <a href="https://packages.debian.org/stretch/apt-transport-https">apt-transport-https package</a>
 is required. Install it with
 <blockquote><pre>
 &num; apt install apt-transport-https
 </pre></blockquote>
 to enable all package managers using the libapt-pkg library to access metadata
 and packages available in sources accessible over https (Hypertext Transfer Protocol Secure).
 </p>
 
 <p>
 <b>sources.list</b>:
 You'll need to set up our package repository before you can fetch Tor. First,
 you need to figure out the name of your distribution. A quick command to run is
 <tt>lsb_release -c</tt> or <tt>cat /etc/debian_version</tt>.
 If in doubt about your Debian version, check
 <a href="https://www.debian.org/releases/">the Debian website</a>.
 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;">
1e529dfd
 <blockquote>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>
a08d3216
 <option value="cosmic">Ubuntu Cosmic Cuttlefish (18.10)</option>
6bfcba96
 </select>
186abc67
 and want
d4e1a357
 <select id="package"></select>
 <select id="version"></select>
6bfcba96
 </blockquote>
 
 <div id="apt-source">
1e529dfd
 <p>
 You need to add the following entries to <code>/etc/apt/sources.list</code>
 or a new file in <code>/etc/apt/sources.list.d/</code>:
 </p>
6bfcba96
 
1e529dfd
 <blockquote><pre id="sources">
 deb https://deb.torproject.org/torproject.org jessie main
6bfcba96
 </pre></blockquote>
 </div>
c22b7380
 
6bfcba96
 <div id="sig">
1e529dfd
 <p>Then add the gpg key used to sign the packages by running the following
 commands at your command prompt:
6bfcba96
 <blockquote><pre>
cb39c0a5
 &num; gpg2 --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
 &num; gpg2 --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
1e529dfd
 </pre></blockquote></p>
6bfcba96
 </div>
 
 <div id="apt-get">
1e529dfd
 <p>We provide a Debian package to help you keep our signing key current. It is
 recommended you use it. Install it with the following commands:</p>
 <blockquote><pre>&num; apt update
 <span id="regular-install">&num; apt install <span id="apt-package">tor</span> deb.torproject.org-keyring</span>
 <span id="source-install">&num; apt install build-essential fakeroot devscripts
 &num; apt build-dep tor deb.torproject.org-keyring
 </span>
 </pre></blockquote>
6bfcba96
 
 <div id="source-install2">
5ad79e06
 <p>Then you can build Tor in ~/debian-packages:</p>
6bfcba96
 <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>
1e529dfd
 &num; dpkg -i tor_*.deb
6bfcba96
 </pre></blockquote>
 </div>
 </div>
 </div>
 
 <noscript>
 <p>
1e529dfd
 Then add this line to your <tt>/etc/apt/sources.list</tt> file:<br />
 <blockquote><pre>
0f3c0995
 deb     https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
b9852566
 </pre></blockquote>
fc4589a3
 where you put the codename of your distribution (i.e. stretch, buster, sid
1e529dfd
 or whatever it is) in place of &lt;DISTRIBUTION&gt;.
c22b7380
 </p>
 
5ad79e06
 <p>
1e529dfd
 If you want to use the
 <a href="<page download/download-unix>#packagediff">development branch</a>
 of Tor instead (more features and more bugs), you need add a different set of
 lines to your <i>/etc/apt/sources.list</i> file:<br />
 <blockquote><pre>
5ad79e06
 deb     https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
 deb     https://deb.torproject.org/torproject.org tor-experimental-0.3.4.x-&lt;DISTRIBUTION&gt; main
 </pre></blockquote>
 </p>
 
c22b7380
 <p>
 Then add the gpg key used to sign the packages by running the following
 commands at your command prompt:
1e529dfd
 <blockquote><pre>
cb39c0a5
 &num; gpg2 --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
 &num; gpg2 --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
1e529dfd
 </pre></blockquote>
af46839e
 Now refresh your sources, running the following command (as root) at your
 command prompt:
1e529dfd
 <blockquote><pre>
 &num; apt update
 </pre></blockquote>
af46839e
 If there are no errors you're good to continue.
 </p>
 
 <p>
1e529dfd
 We provide a Debian package to help you keep our signing key current. It is
 recommended you use it. Install it together with tor:
 <blockquote><pre>
 &num; apt install tor deb.torproject.org-keyring
 </pre></blockquote>
c22b7380
 </p>
 
6bfcba96
 </noscript>
5ad79e06
 <noscript>
c22b7380
 
 <hr />
 
 <a id="source"></a>
 <h2><a class="anchor" href="#source">Building from source</a></h2>
 
 <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>.
1e529dfd
 </p>
 <blockquote><pre>
 &num; For the stable version.
0f3c0995
 deb-src https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
c22b7380
 
1e529dfd
 &num; For the unstable version.
0f3c0995
 deb-src https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
4375e270
 deb-src https://deb.torproject.org/torproject.org tor-experimental-0.3.4.x-&lt;DISTRIBUTION&gt; main
1e529dfd
 </pre></blockquote>
 <p>
 Substitute the name of your distro (stretch, buster, sid, xenial, ...) in
 place of &lt;DISTRIBUTION&gt;. Now refresh your sources by running (as root):
 </p>
 <blockquote><pre>
 &num; apt update
 </pre></blockquote>
 <p>
37f37e9a
 You also need to install the necessary packages to build your own debs and the
c22b7380
 packages needed to build Tor:
1e529dfd
 </p>
 <blockquote><pre>
 &num; apt install build-essential fakeroot devscripts
 &num; apt build-dep tor
 </pre></blockquote>
 <p>
c22b7380
 Then you can build Tor in ~/debian-packages:
1e529dfd
 </p>
 <blockquote><pre>
 $ mkdir ~/debian-packages; cd ~/debian-packages
 $ apt source tor
 $ cd tor-*
 $ debuild -rfakeroot -uc -us
 $ cd ..
 </pre></blockquote>
 <p>
c22b7380
 Now you can install the new package:
 </p>
1e529dfd
 <blockquote><pre>
 &num; dpkg -i tor_*.deb
 </pre></blockquote>
 
 </noscript>
c22b7380
 
 <p>
1e529dfd
 Now Tor is installed and running. Move on to
 <a href="<page docs/tor-doc-unix>#using">step two</a> of the
 "Tor on Linux/Unix" instructions.
 </p>
 
 <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>
 
 <hr />
 
 <a id="apt-over-tor"></a>
 <h2><a class="anchor" href="#apt-over-tor">Use Apt over Tor</a></h2>
 
 <p>
 <code>deb.torproject.org</code> is also served through via an onion service:
 <a href="http://sdscoq7snqtznauu.onion">http://sdscoq7snqtznauu.onion/</a>
 </p>
 
 <p>
 To use Apt with Tor the according apt transport needs to be installed:
 </p>
 <blockquote><pre>
 &num; apt install apt-transport-tor
 </pre></blockquote>
 
 <p>
 Then replace the address in the lines added before with, for example:
 </p>
 <blockquote><pre>
 &num; For the stable version.
 deb tor://sdscoq7snqtznauu.onion/torproject.org &lt;DISTRIBUTION&gt; main
 
 &num; For the unstable version.
 deb tor://sdscoq7snqtznauu.onion/torproject.org tor-nightly-master-&lt;DISTRIBUTION&gt; main
 </pre></blockquote>
 <p>
 Now refresh your sources and try if it's still possible to install tor:
 </p>
 <blockquote><pre>
 &num; apt update
 &num; apt install tor
 </pre></blockquote>
 <p>
 See <a href="https://onion.torproject.org/">onion.torproject.org</a>
 for all torproject.org onion addresses.</p>
c22b7380
 </p>
 
 <!-- END MAIN COL -->
2a9aaa80
   </div>
   <div id = "sidecol">
 #include "side.wmi"
 #include "info.wmi"
   </div>
   <!-- END SIDECOL -->
 </div>
 <!-- END CONTENT -->
37f37e9a
 #include <foot.wmi>