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"
6bfcba96
 
 <script>
 <!--
 // This code is based on the http://mozilla.debian.net sources.list
 // generator as originally written by Mike Hommey. It is licensed under
 // the terms of the GNU GPLv2, http://www.gnu.org/licenses/gpl-2.0.html.
 var sources = {};
 var software = {
cda1afc3
 'tor': { '_stable': {
6bfcba96
                      'wheezy':  [ 'wheezy' ],
                      'jessie':  [ 'jessie' ],
b30c3353
                      'stretch': [ 'stretch' ],
6bfcba96
                      'sid':     [ 'sid' ],
                      'precise': [ 'precise'],
cda1afc3
                      'trusty':  [ 'trusty'],
                      'wily':    [ 'wily'],
                      'xenial':  [ 'xenial'],
                      },
3c84d624
          'experimental-0.2.9.x': {
cda1afc3
                      'wheezy':  [ 'wheezy' ],
6bfcba96
                      'jessie':  [ 'jessie' ],
b30c3353
                      'stretch': [ 'stretch' ],
6bfcba96
                      'sid':     [ 'sid' ],
                      'precise': [ 'precise'],
cda1afc3
                      'trusty':  [ 'trusty'],
                      'wily':    [ 'wily'],
                      'xenial':  [ 'xenial'],
                      },
6bfcba96
        },
cda1afc3
 'tor (from source)': {
          '_stable': {
6bfcba96
                      'wheezy':  [ 'wheezy' ],
                      'jessie':  [ 'jessie' ],
b30c3353
                      'stretch': [ 'stretch' ],
6bfcba96
                      'sid':     [ 'sid' ],
                      'precise': [ 'precise'],
cda1afc3
                      'trusty':  [ 'trusty'],
                      'wily':    [ 'wily'],
                      'xenial':  [ 'xenial'],
                      },
3c84d624
          'experimental-0.2.9.x': {
cda1afc3
                      'wheezy':  [ 'wheezy' ],
6bfcba96
                      'jessie':  [ 'jessie' ],
b30c3353
                      'stretch': [ 'stretch' ],
6bfcba96
                      'sid':     [ 'sid' ],
                      'precise': [ 'precise'],
cda1afc3
                      'trusty':  [ 'trusty'],
                      'wily':    [ 'wily'],
                      'xenial':  [ 'xenial'],
                      },
6bfcba96
        },
 };
 
 function init() {
     pkg = document.getElementById('package');
     for (soft in software) {
         if (soft != pkg.value) {
             option = document.createElement('option');
             option.value = soft;
             option.appendChild(document.createTextNode(soft.charAt(0).toUpperCase() + soft.slice(1)));
             pkg.appendChild(option);
         }
     }
 
     apt_get = document.getElementById('apt-get');
     para = document.createElement('p');
     para.id = 'sorry';
     para.style.display = 'none';
     apt_get.parentNode.insertBefore(para, apt_get);
     para.appendChild(document.createTextNode("Sorry, this version is not available.\n"));
 
     document.getElementById('selector').style.display = 'block';
 
     update();
 }
 
 function replaceText(src, txt) {
     while (src.firstChild)
         src.removeChild(src.firstChild);
     src.appendChild(document.createTextNode(txt));
 }
 
 function update() {
     pkg = document.getElementById('package');
     ver = document.getElementById('version');
     package = pkg.value;
     version = ver.value;
     distrib = document.getElementById('distrib').value;
     if (package != pkg.prev) {
         while (ver.firstChild)
             ver.removeChild(ver.firstChild);
7cd8071c
         var selected;
6bfcba96
         for (version in software[package]) {
             option = document.createElement('option');
             if (version[0] == '_') {
                 version = version.slice(1);
7cd8071c
                 selected = version;
6bfcba96
             }
             option.appendChild(document.createTextNode(version));
             option.value = version = version.replace(/ \(.*\)/,'');
 //alert(version);
             ver.appendChild(option);
         }
7cd8071c
         ver.value = version = selected || version;
6bfcba96
         pkg.prev = package
     }
     try {
         keys = software[package][version][distrib];
     } catch (e) {
         try {
             keys = software[package]['_' + version][distrib];
         } catch (e) { };
     }
     src = document.getElementById('sources');
     txt = '';
     need_signed = false;
     source_install = false;
     target = '';
     for (i = 0; keys && (i < keys.length); i++) {
 //alert(keys[i]);
         if (keys[i] in sources) {
             txt += sources[keys[i]];
             target = keys[i];
         } else {
             if (package.slice(-7, -1) == 'source') {
                 package = package.split(' ')[0];
29adba25
                 source_install = true;
6bfcba96
             }
29adba25
             txt += "http://deb.torproject.org/torproject.org";
6bfcba96
             txt += " ";
             txt += keys[i];
             txt += " main";
             need_signed = true;
             target = keys[i];
29adba25
             txt = "deb " + txt + "\ndeb-src " + txt;
d671689f
             if (version != 'stable') {
                 txt2 = "http://deb.torproject.org/torproject.org";
                 txt2 += " ";
                 txt2 += package;
                 txt2 += "-";
                 txt2 += version;
                 txt2 += "-";
                 txt2 += keys[i];
                 txt2 += " main";
                 txt = txt + "\ndeb " + txt2 + "\ndeb-src " + txt2;
             }
6bfcba96
         }
         txt += "\n";
     }
     replaceText(src, txt);
     document.getElementById('regular-install').style.display = source_install ? 'none' : 'block';
     document.getElementById('source-install').style.display = source_install ? 'block' : 'none';
     document.getElementById('source-install2').style.display = source_install ? 'block' : 'none';
     replaceText(document.getElementById('apt-package'), package);
     document.getElementById('apt-source').style.display = (keys && keys.length) ? 'block' : 'none';
     document.getElementById('apt-get').style.display = keys ? 'block' : 'none';
     document.getElementById('sorry').style.display = keys ? 'none' : 'block';
 }
 
 window.onload = init;
 
 -->
 </script>
 
 
 
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>
6e6b263c
 <h2><a class="anchor" href="#debian">Option one: Tor on Debian stable,
c22b7380
 Debian sid, or Debian testing</a></h2>
 <br />
 
 <p>
6bfcba96
 If you're using Debian, just run
 </blockquote><pre>  apt-get install tor </pre></blockquote>
c22b7380
 as root.
 </p>
 
 <p>
 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.
 </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>
 <b>Raspbian is not Debian.</b> These packages will 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>.
363e2bcd
 If in doubt about your Debian version, check <a href="http://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;">
 <blockquote>
186abc67
 I run
6bfcba96
 <select id="distrib" onchange="update()">
7e44204f
 <option value="wheezy">Debian oldstable (wheezy)</option>
 <option value="jessie" selected="selected">Debian stable (jessie)</option>
 <option value="stretch">Debian testing (stretch)</option>
44cb1888
 <option value="sid">Debian unstable (sid)</option>
6bfcba96
 <option value="precise">Ubuntu Precise Pangolin</option>
 <option value="trusty">Ubuntu Trusty Tahr</option>
7e44204f
 <option value="wily">Ubuntu Wily Werewolf</option>
 <option value="xenial">Ubuntu Xenial Xerus</option>
6bfcba96
 </select>
186abc67
 and want
6bfcba96
 <select id="package" onchange="update()"></select>
 version
 <select id="version" onchange="update()"></select>
 </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>
 
 <blockquote><pre id="sources">deb http://deb.torproject.org/torproject.org wheezy main
 </pre></blockquote>
 </div>
c22b7380
 
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>
 gpg --keyserver keys.gnupg.net --recv 886DDD89
 gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
 </pre></blockquote>
 </div>
 
 
 <div id="apt-get">
 <p>You can install it with the following commands:</p>
 <blockquote><pre>$ apt-get update
 <span id="regular-install">$ apt-get install <span id="apt-package">tor</span> deb.torproject.org-keyring</span>
 <span id="source-install">$ apt-get install build-essential fakeroot devscripts
 $ apt-get build-dep tor deb.torproject.org-keyring</span></pre></blockquote>
 
 <div id="source-install2">
 <p>
 Then you can build Tor in ~/debian-packages:
 </p>
 <blockquote><pre>
 $ mkdir ~/debian-packages; cd ~/debian-packages
 $ apt-get source tor
 $ 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">
c22b7380
 deb     http://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
 </pre>
74a3475b
 where you put the codename of your distribution (i.e. lenny, sid,
b38bc7d3
 saucy 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">
c22b7380
 gpg --keyserver keys.gnupg.net --recv 886DDD89
 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">
c22b7380
 apt-get 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">
af46839e
 apt-get install deb.torproject.org-keyring
 </pre>
 </p>
 
 <p>
 To finally install Tor just run:
9afa5bcd
 <pre style="margin: 1.5em 0 1.5em 2em">
af46839e
 apt-get 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>
 
 <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
 download/download>#packagediff">development branch</a> of Tor instead
 (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">
c22b7380
 deb     http://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
3c84d624
 deb     http://deb.torproject.org/torproject.org tor-experimental-0.2.9.x-&lt;DISTRIBUTION&gt; main
c22b7380
 </pre>
74a3475b
 where you again substitute the name of your distro (lenny,
b38bc7d3
 sid, saucy, ...) 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">
c22b7380
 gpg --keyserver keys.gnupg.net --recv 886DDD89
 gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
 apt-get update
2a20852a
 apt-get 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.
 deb-src http://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
 
 # For the unstable version.
 deb-src http://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
3c84d624
 deb-src http://deb.torproject.org/torproject.org tor-experimental-0.2.9.x-&lt;DISTRIBUTION&gt; main
c22b7380
 </pre>
9215766f
 Substitute the name of your distro (wheezy, sid, trusty, ...) in place of &lt;DISTRIBUTION&gt;. Now refresh your sources by running (as root):
 <pre style="margin: 1.5em 0 1.5em 2em">
 apt-get update
 </pre>
 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">
c22b7380
 apt-get install build-essential fakeroot devscripts
 apt-get build-dep tor
 </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
 apt-get source tor
 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 -->
 #include <foot.wmi>