docs/debian: improve the guide (#27278)
traumschule

traumschule commited on 2018-08-24 01:58:07
Zeige 1 geänderte Dateien mit 168 Einfügungen und 137 Löschungen.

... ...
@@ -15,25 +15,26 @@
15 15
   </div>
16 16
   <div id="maincol">
17 17
 <a id="debian"></a>
18
-<h2><a class="anchor" href="#debian">Option one: Tor on Debian Stretch - stable,
19
-Debian Buster - testing, or Debian Sid - unstable</a></h2>
18
+<h2><a class="anchor" href="#debian">Option one: Tor on Debian Stretch - 
19
+stable, Debian Buster - testing, or Debian Sid - unstable</a></h2>
20 20
 <br />
21 21
 
22 22
 <p>
23 23
 If you're using Debian, just run as root:
24
-</blockquote><pre>  apt install tor </pre></blockquote>
24
+<blockquote><pre># apt install tor</pre></blockquote>
25 25
 </p>
26 26
 
27
-<p>Debian provides the <a href="https://packages.debian.org/stretch/tor">LTS</a>
27
+<p>Debian provides the
28
+<a href="https://packages.debian.org/stretch/tor">LTS</a>
28 29
 version of Tor. Note that this might not always give you the latest stable
29 30
 Tor version, but you will receive important security fixes. To make sure
30 31
 that you're running the latest stable version of Tor, see option two below.
31 32
 </p>
32 33
 
33 34
 <p>
34
-When Tor is installed and running move on to <a href="<page
35
-docs/tor-doc-unix>#using">step two</a> of the "<a href="<page
36
-docs/tor-doc-unix>">Tor on Linux/Unix</a>" instructions.
35
+When Tor is installed and running move on to 
36
+<a href="<page docs/tor-doc-unix>#using">step two</a> of the
37
+"<a href="<page docs/tor-doc-unix>">Tor on Linux/Unix</a>" instructions.
37 38
 </p>
38 39
 
39 40
 <hr />
... ...
@@ -42,7 +43,6 @@ docs/tor-doc-unix>">Tor on Linux/Unix</a>" instructions.
42 43
 <a id="packages"></a>
43 44
 <h2><a class="anchor" href="#ubuntu">Option two: Tor on Ubuntu or 
44 45
 Debian</a></h2>
45
-<br />
46 46
 
47 47
 <p>
48 48
 <b>Do not use the packages in Ubuntu's universe.</b> In the past they have
... ...
@@ -51,24 +51,50 @@ and security fixes.
51 51
 </p>
52 52
 
53 53
 <p>
54
-<b>Raspbian is not Debian.</b> Tor might run fine on the Raspberry Pi 2 / 3 but not the first generation Pi.
55
-These packages might be confusingly broken for Raspbian users, since Raspbian called their architecture armhf but
56
-Debian already has an armhf. See <a
54
+<b>Raspbian is not Debian.</b> Tor might run fine on the Raspberry Pi 2 / 3
55
+but not the first generation Pi.
56
+These packages might be confusingly broken for Raspbian users, since Raspbian 
57
+called their architecture armhf but Debian already has an armhf. See <a
57 58
 href="http://tor.stackexchange.com/questions/242/how-to-run-tor-on-raspbian-on-the-raspberry-pi">this
58 59
 post</a> for details.
59 60
 </p>
60 61
 
61 62
 <p>
62
-You'll need to set up our package repository before you can fetch
63
-Tor. First, you need to figure out the name of your distribution. A
64
-quick command to run is <tt>lsb_release -c</tt> or <tt>cat /etc/debian_version</tt>.
65
-If in doubt about your Debian version, check <a href="https://www.debian.org/releases/">the Debian website</a>.
66
-For Ubuntu, ask <a href="https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Table_of_versions">Wikipedia</a>.
63
+<b>Admin access</b>:
64
+To install Tor you need root privileges. Below all commands that need to be run
65
+as root user like apt and dpkg are prepended with '&num;',
66
+while commands to be run as user with '$' resembling the standard
67
+prompt in a terminal. To open a root terminal you have several options:
68
+<code>sudo su</code>, or <code>sudo -i</code>,  or <code>su -i</code>.
69
+Note that sudo asks for your user password, while su expects
70
+the root password of your system.
71
+</p>
72
+
73
+<p>
74
+<b>apt-transport-tor</b>:
75
+To use source lines with <tt>https://</tt> in <i>/etc/apt/sources.list</i> the
76
+<a href="https://packages.debian.org/stretch/apt-transport-https">apt-transport-https package</a>
77
+is required. Install it with
78
+<blockquote><pre>
79
+&num; apt install apt-transport-https
80
+</pre></blockquote>
81
+to enable all package managers using the libapt-pkg library to access metadata
82
+and packages available in sources accessible over https (Hypertext Transfer Protocol Secure).
83
+</p>
84
+
85
+<p>
86
+<b>sources.list</b>:
87
+You'll need to set up our package repository before you can fetch Tor. First,
88
+you need to figure out the name of your distribution. A quick command to run is
89
+<tt>lsb_release -c</tt> or <tt>cat /etc/debian_version</tt>.
90
+If in doubt about your Debian version, check
91
+<a href="https://www.debian.org/releases/">the Debian website</a>.
92
+For Ubuntu, ask
93
+<a href="https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Table_of_versions">Wikipedia</a>.
67 94
 </p>
68 95
 
69 96
 <div id="selector" style="display: none;">
70
-<blockquote>
71
-I run
97
+<blockquote>I run
72 98
 <select id="distrib">
73 99
 <option value="jessie">Debian oldstable (jessie)</option>
74 100
 <option value="stretch" selected="selected">Debian stable (stretch)</option>
... ...
@@ -81,48 +107,38 @@ I run
81 107
 </select>
82 108
 and want
83 109
 <select id="package"></select>
84
-version
85 110
 <select id="version"></select>
86 111
 </blockquote>
87 112
 
88
-
89 113
 <div id="apt-source">
90
-<p>You need to add the following entries to <code>/etc/apt/sources.list</code> or a new file in
91
-<code>/etc/apt/sources.list.d/</code>:</p>
114
+<p>
115
+You need to add the following entries to <code>/etc/apt/sources.list</code>
116
+or a new file in <code>/etc/apt/sources.list.d/</code>:
117
+</p>
92 118
 
93
-<blockquote><pre id="sources">deb https://deb.torproject.org/torproject.org jessie main
119
+<blockquote><pre id="sources">
120
+deb https://deb.torproject.org/torproject.org jessie main
94 121
 </pre></blockquote>
95 122
 </div>
96 123
 
97
-<p>Note: To use source lines with https:// in <i>/etc/apt/sources.list</i> the <a
98
-href="https://packages.debian.org/stretch/apt-transport-https">apt-transport-https
99
-package</a> is required. Install it with
100
-<blockquote><pre>
101
-apt install apt-transport-https
102
-</pre></blockquote>
103
-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>
104
-
105
-<p>To use Apt with Tor later replace <tt>https://</tt> with <tt>tor://</tt> and run
106
-<blockquote><pre>
107
-apt install apt-transport-tor
108
-</pre></blockquote>
109
-</p>
110
-
111 124
 <div id="sig">
112
-<p>Then add the gpg key used to sign the packages by running the following commands at your command prompt:</p>
125
+<p>Then add the gpg key used to sign the packages by running the following
126
+commands at your command prompt:
113 127
 <blockquote><pre>
114
-gpg --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
115
-gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
116
-</pre></blockquote>
128
+&num; gpg --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
129
+&num; gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
130
+</pre></blockquote></p>
117 131
 </div>
118 132
 
119
-
120 133
 <div id="apt-get">
121
-<p>You can install it with the following commands:</p>
122
-<blockquote><pre>apt update
123
-<span id="regular-install">apt install <span id="apt-package">tor</span> deb.torproject.org-keyring</span>
124
-<span id="source-install">$ apt install build-essential fakeroot devscripts
125
-$ apt build-dep tor deb.torproject.org-keyring</span></pre></blockquote>
134
+<p>We provide a Debian package to help you keep our signing key current. It is
135
+recommended you use it. Install it with the following commands:</p>
136
+<blockquote><pre>&num; apt update
137
+<span id="regular-install">&num; apt install <span id="apt-package">tor</span> deb.torproject.org-keyring</span>
138
+<span id="source-install">&num; apt install build-essential fakeroot devscripts
139
+&num; apt build-dep tor deb.torproject.org-keyring
140
+</span>
141
+</pre></blockquote>
126 142
 
127 143
 <div id="source-install2">
128 144
 <p>Then you can build Tor in ~/debian-packages:</p>
... ...
@@ -135,7 +151,7 @@ $ cd ..
135 151
 </pre></blockquote>
136 152
 <p>Now you can install the new package:</p>
137 153
 <blockquote><pre>
138
-$ sudo dpkg -i tor_*.deb
154
+&num; dpkg -i tor_*.deb
139 155
 </pre></blockquote>
140 156
 </div>
141 157
 </div>
... ...
@@ -143,140 +159,155 @@ $ sudo dpkg -i tor_*.deb
143 159
 
144 160
 <noscript>
145 161
 <p>
146
-Then add this line to your
147
-<tt>/etc/apt/sources.list</tt>
148
-file:<br />
149
-<pre style="margin: 1.5em 0 1.5em 2em">
162
+Then add this line to your <tt>/etc/apt/sources.list</tt> file:<br />
163
+<blockquote><pre>
150 164
 deb     https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
151
-</pre>
165
+/pre></blockquote>
152 166
 where you put the codename of your distribution (i.e. stretch, buster, sid
153
-or whatever it is)
154
-in place of &lt;DISTRIBUTION&gt;.
167
+or whatever it is) in place of &lt;DISTRIBUTION&gt;.
155 168
 </p>
156 169
 
157 170
 <p>
158
-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 />
159
-<pre style="margin: 1.5em 0 1.5em 2em">
171
+If you want to use the
172
+<a href="<page download/download-unix>#packagediff">development branch</a>
173
+of Tor instead (more features and more bugs), you need add a different set of
174
+lines to your <i>/etc/apt/sources.list</i> file:<br />
175
+<blockquote><pre>
160 176
 deb     https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
161 177
 deb     https://deb.torproject.org/torproject.org tor-experimental-0.3.4.x-&lt;DISTRIBUTION&gt; main
162
-</pre>
163
-</p>
164
-
165
-<p>Note: To use source lines with <tt>https://</tt> in <i>/etc/apt/sources.list</i> the <a
166
-href="https://packages.debian.org/stretch/apt-transport-https">apt-transport-https
167
-package</a> is required. Install it with
168
-<blockquote><pre>
169
-apt install apt-transport-https
170
-</pre></blockquote>
171
-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>
172
-
173
-<p>To use Apt with Tor later replace <tt>https://</tt> with <tt>tor://</tt> and run <blockquote><pre>
174
-apt install apt-transport-tor
175 178
 </pre></blockquote>
176 179
 </p>
177 180
 
178 181
 <p>
179 182
 Then add the gpg key used to sign the packages by running the following
180 183
 commands at your command prompt:
181
-<pre style="margin: 1.5em 0 1.5em 2em">
182
-gpg --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
183
-gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
184
-</pre>
184
+<blockquote><pre>
185
+&num; gpg --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
186
+&num; gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
187
+</pre></blockquote>
185 188
 Now refresh your sources, running the following command (as root) at your
186 189
 command prompt:
187
-<pre style="margin: 1.5em 0 1.5em 2em">
188
-apt update
189
-</pre>
190
+<blockquote><pre>
191
+&num; apt update
192
+</pre></blockquote>
190 193
 If there are no errors you're good to continue.
191 194
 </p>
192 195
 
193 196
 <p>
194 197
 We provide a Debian package to help you keep our signing key current. It is
195
-recommended you use it.  Install it along with tor using
196
-<pre style="margin: 1.5em 0 1.5em 2em">
197
-apt install tor deb.torproject.org-keyring
198
-</pre>
198
+recommended you use it. Install it together with tor:
199
+<blockquote><pre>
200
+&num; apt install tor deb.torproject.org-keyring
201
+</pre></blockquote>
199 202
 </p>
200 203
 
201 204
 </noscript>
202
-
203
-<p>
204
-Now Tor is installed and running. Move on to <a href="<page
205
-docs/tor-doc-unix>#using">step two</a> of the "Tor on Linux/Unix"
206
-instructions.
207
-</p>
208
-
209
-<p style="font-size: small">
210
-The DNS name <code>deb.torproject.org</code> is actually a set of independent
211
-servers in a DNS round robin configuration.  If you for some reason cannot
212
-access it you might try to use the name of one of its part instead.  Try
213
-<code>deb-master.torproject.org</code>,
214
-<code>mirror.netcologne.de</code> or
215
-<code>tor.mirror.youam.de</code>.
216
-</p>
217
-
218
-<p><code>deb.torproject.org</code> is also served through now also served via onion service:
219
-<a href="http://sdscoq7snqtznauu.onion">http://sdscoq7snqtznauu.onion/</a> To use the onion service with apt, replace the address in the previously added lines:
220
-<pre style="margin: 1.5em 0 1.5em 2em">.
221
-# For the stable version.
222
-deb tor://sdscoq7snqtznauu.onion/torproject.org buster main
223
-
224
-# For the unstable version.
225
-deb tor://sdscoq7snqtznauu.onion/torproject.org tor-nightly-master-&lt;DISTRIBUTION&gt; main
226
-</pre>
227
-<br />
228
-See <a href="https://onion.torproject.org/">https://onion.torproject.org</a> for all
229
-torproject.org onion addresses.</p>
230
-
231 205
 <noscript>
232 206
 
233 207
 <hr />
234 208
 
235 209
 <a id="source"></a>
236 210
 <h2><a class="anchor" href="#source">Building from source</a></h2>
237
-<br />
238 211
 
239 212
 <p>
240 213
 If you want to build your own debs from source you must first add an
241 214
 appropriate <tt>deb-src</tt> line to <tt>sources.list</tt>.
242
-<pre style="margin: 1.5em 0 1.5em 2em">
243
-# For the stable version.
215
+</p>
216
+<blockquote><pre>
217
+&num; For the stable version.
244 218
 deb-src https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
245 219
 
246
-# For the unstable version.
220
+&num; For the unstable version.
247 221
 deb-src https://deb.torproject.org/torproject.org &lt;DISTRIBUTION&gt; main
248 222
 deb-src https://deb.torproject.org/torproject.org tor-experimental-0.3.4.x-&lt;DISTRIBUTION&gt; main
249
-</pre>
250
-Substitute the name of your distro (stretch, buster, sid, xenial, ...) in place of &lt;DISTRIBUTION&gt;. Now refresh your sources by running (as root):
251
-<pre style="margin: 1.5em 0 1.5em 2em">
252
-apt update
253
-</pre>
223
+</pre></blockquote>
224
+<p>
225
+Substitute the name of your distro (stretch, buster, sid, xenial, ...) in
226
+place of &lt;DISTRIBUTION&gt;. Now refresh your sources by running (as root):
227
+</p>
228
+<blockquote><pre>
229
+&num; apt update
230
+</pre></blockquote>
231
+<p>
254 232
 You also need to install the necessary packages to build your own debs and the
255 233
 packages needed to build Tor:
256
-<pre style="margin: 1.5em 0 1.5em 2em">
257
-apt install build-essential fakeroot devscripts
258
-apt build-dep tor
259
-</pre>
234
+</p>
235
+<blockquote><pre>
236
+&num; apt install build-essential fakeroot devscripts
237
+&num; apt build-dep tor
238
+</pre></blockquote>
239
+<p>
260 240
 Then you can build Tor in ~/debian-packages:
261
-<pre style="margin: 1.5em 0 1.5em 2em">
262
-mkdir ~/debian-packages; cd ~/debian-packages
263
-apt source tor
264
-cd tor-*
265
-debuild -rfakeroot -uc -us
266
-cd ..
267
-</pre>
241
+</p>
242
+<blockquote><pre>
243
+$ mkdir ~/debian-packages; cd ~/debian-packages
244
+$ apt source tor
245
+$ cd tor-*
246
+$ debuild -rfakeroot -uc -us
247
+$ cd ..
248
+</pre></blockquote>
249
+<p>
268 250
 Now you can install the new package:
269
-<pre style="margin: 1.5em 0 1.5em 2em">
270
-sudo dpkg -i tor_*.deb
271
-</pre>
272 251
 </p>
252
+<blockquote><pre>
253
+&num; dpkg -i tor_*.deb
254
+</pre></blockquote>
255
+
256
+</noscript>
273 257
 
274 258
 <p>
275
-Now Tor is installed and running. Move on to <a href="<page
276
-docs/tor-doc-unix>#using">step two</a> of the "Tor on Linux/Unix"
277
-instructions.
259
+Now Tor is installed and running. Move on to
260
+<a href="<page docs/tor-doc-unix>#using">step two</a> of the
261
+"Tor on Linux/Unix" instructions.
262
+</p>
263
+
264
+<p style="font-size: small">
265
+The DNS name <code>deb.torproject.org</code> is actually a set of independent
266
+servers in a DNS round robin configuration. If you for some reason cannot
267
+access it you might try to use the name of one of its part instead. Try
268
+<code>deb-master.torproject.org</code>,
269
+<code>mirror.netcologne.de</code> or
270
+<code>tor.mirror.youam.de</code>.
271
+</p>
272
+
273
+<hr />
274
+
275
+<a id="apt-over-tor"></a>
276
+<h2><a class="anchor" href="#apt-over-tor">Use Apt over Tor</a></h2>
277
+
278
+<p>
279
+<code>deb.torproject.org</code> is also served through via an onion service:
280
+<a href="http://sdscoq7snqtznauu.onion">http://sdscoq7snqtznauu.onion/</a>
281
+</p>
282
+
283
+<p>
284
+To use Apt with Tor the according apt transport needs to be installed:
285
+</p>
286
+<blockquote><pre>
287
+&num; apt install apt-transport-tor
288
+</pre></blockquote>
289
+
290
+<p>
291
+Then replace the address in the lines added before with, for example:
292
+</p>
293
+<blockquote><pre>
294
+&num; For the stable version.
295
+deb tor://sdscoq7snqtznauu.onion/torproject.org &lt;DISTRIBUTION&gt; main
296
+
297
+&num; For the unstable version.
298
+deb tor://sdscoq7snqtznauu.onion/torproject.org tor-nightly-master-&lt;DISTRIBUTION&gt; main
299
+</pre></blockquote>
300
+<p>
301
+Now refresh your sources and try if it's still possible to install tor:
302
+</p>
303
+<blockquote><pre>
304
+&num; apt update
305
+&num; apt install tor
306
+</pre></blockquote>
307
+<p>
308
+See <a href="https://onion.torproject.org/">onion.torproject.org</a>
309
+for all torproject.org onion addresses.</p>
278 310
 </p>
279
-</noscript>
280 311
 
281 312
 <!-- END MAIN COL -->
282 313
   </div>
283 314