summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/lib/live/config/1500-reconfigure-APT
blob: b20eac3d00bd93e1cd8bc868a3edbdaecffd1ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh

echo "- configuring APT sources"

sed -i 's,^\(\#\?\s*deb\(-src\)\?\s\+\)http://,\1tor+http://,' \
           /etc/apt/sources.list /etc/apt/sources.list.d/*.list

sed -E -i 's,\s+non-free$,,' \
           /etc/apt/sources.list /etc/apt/sources.list.d/*.list

sed -E -i '/^deb(-src)?\s+\S+\s+\S+-proposed-updates\s+/d' \
           /etc/apt/sources.list /etc/apt/sources.list.d/*.list

echo '

### Time-based snapshots

s{
   ^
   (deb(?:-src)?\s+)
   tor[+]https?://time-based[.]snapshots[.]deb[.]tails[.]boum[.]org
   /debian
   /[0-9]{10} # serial
   /?
   (\s+)
}{$1tor+http://vwakviie2ienjx6t.onion/debian/$2}xms;

s{
   ^
   (deb(?:-src)?\s+)
   tor[+]https?://time-based[.]snapshots[.]deb[.]tails[.]boum[.]org
   /debian-security
   /[0-9]{10} # serial
   /?
   (\s+)
}{$1tor+http://sgvtcaew4bxjd7ln.onion/$2}xms;

s{
   ^
   (deb(?:-src)?\s+)
   tor[+]https?://time-based[.]snapshots[.]deb[.]tails[.]boum[.]org
   /torproject
   /[0-9]{10} # serial
   /?
   (\s+)
}{$1tor+http://sdscoq7snqtznauu.onion/torproject.org/$2}xms;

### Tagged snapshots

s{
   ^
   (deb(?:-src)?\s+)
   tor[+]https?://tagged[.]snapshots[.]deb[.]tails[.]boum[.]org
   /[0-9a-z.-]+ # tag
   /debian
   /?
   (\s+)
}{$1tor+http://vwakviie2ienjx6t.onion/debian/$2}xms;

s{
   ^
   (deb(?:-src)?\s+)
   tor[+]https?://tagged[.]snapshots[.]deb[.]tails[.]boum[.]org
   /[0-9a-z.-]+ # tag
   /debian-security
   /?
   (\s+)
}{$1tor+http://sgvtcaew4bxjd7ln.onion/$2}xms;

s{
   ^
   (deb(?:-src)?\s+)
   tor[+]https?://tagged[.]snapshots[.]deb[.]tails[.]boum[.]org
   /[0-9a-z.-]+ # tag
   /torproject
   /?
   (\s+)
}{$1tor+http://sdscoq7snqtznauu.onion/torproject.org/$2}xms;

### Custom APT repository

s{
   ^
   (deb(?:-src)?\s+)
   tor[+]https?://deb[.]tails[.]boum[.]org
   /?
   (\s+)
}{$1tor+http://jenw7xbd6tf7vfhp.onion/$2}xms;

' | perl -pi - /etc/apt/sources.list /etc/apt/sources.list.d/*.list

find /etc/apt/sources.list* -size 0 -delete