add some kernel stuff for amd64
[mirror/dsa-wiki.git] / input / howto / upgrade-to-lenny.mdwn
1
2 # Upgrade from etch to lenny
3
4 make apt sane:
5
6         echo 'Acquire::PDiffs "false";' > /etc/apt/apt.conf.d/local-pdiff
7         echo 'APT::Install-Recommends 0;' > /etc/apt/apt.conf.d/local-recommends
8
9
10 add volatile to sources list and upgrade (at least the archive keyring)
11
12         grep volatile /etc/apt/sources.list || cat >> /etc/apt/sources.list << EOF
13         deb     http://volatile.debian.net/debian-volatile etch/volatile  main
14         EOF
15         apt-get update && apt-get dist-upgrade
16
17
18 turn off samhain
19
20         /etc/init.d/samhain stop
21
22
23 maybe turn off exim
24
25         /etc/init.d/exim4 stop
26         mv /etc/rc2.d/S20exim4 /etc/rc2.d/K20exim4 # so it stays down
27
28
29 install deborphan, clean up
30
31         apt-get install deborphan dialog
32         orphaner
33         orphaner -n
34         orphaner -a
35         orphaner -a -n
36
37
38 purge removed packages
39
40         dpkg --get-selections | awk '$2!="install" {print $1}'
41         echo "really purge these [y/N]?"; read ans; [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2!="install" {print $1}'`
42
43
44 remove cruft and prepare sources.list update
45
46         rm -f /etc/apt/sources.liste
47         mkdir -p /etc/apt/sources.list.d
48
49
50 change sources list entries to lenny:
51
52         mirror=`cat /etc/apt/sources.list | awk '/debian/ {print $2; exit}'`
53         echo "Mirror is $mirror"; echo "Fix stuff if this seems wrong"; echo "XXXXXXXXXXXXXXXXXXXXXXX"
54         echo "## VERIFY THE MIRROR IS CORRECT ##"; read
55
56
57 write new sources.list.d/ entries:
58
59         (! [ -e /etc/apt/sources.list ] || mv /etc/apt/sources.list /etc/apt/sources.list-oldetch) &&
60         cd /etc/apt/sources.list.d &&
61         cat > backports.org.list << EOF &&
62         deb     http://debian.sil.at/backports.org/        lenny-backports main
63         EOF
64         sed -e "s#@@MIRROR@@#$mirror#g" > debian.list << EOF &&
65         deb     @@MIRROR@@      lenny           main
66         EOF
67         cat > debian.org.list << EOF &&
68         deb     http://db.debian.org/debian-admin          lenny            main
69         EOF
70         cat > security.list << EOF &&
71         deb     http://security.us.debian.org/             lenny/updates    main
72         EOF
73         cat > volatile.list << EOF &&
74         deb     http://volatile.debian.org/debian-volatile lenny/volatile   main
75         EOF
76         (! [ -e /etc/apt/preferences ] || mv /etc/apt/preferences /etc/apt/preferences-oldetch) &&
77         cat > /etc/apt/preferences << EOF &&
78         Package: *
79         Pin: release o=Backports.org archive
80         Pin-Priority: 200
81         EOF
82         (! grep restricted /etc/apt/sources.list-oldetch || echo 'deb     http://db.debian.org/debian-admin          lenny-restricted non-free' >> debian.org.list )
83
84
85 add bpo key
86
87         apt-key add - << EOF
88         -----BEGIN PGP PUBLIC KEY BLOCK-----
89         Version: GnuPG v1.4.9 (GNU/Linux)
90
91         mQGiBEMIgw4RBADueqAzlq+rQT9JYSSWnNzo6C+9crI8lzW/fcl2Q3PO97MOQTOx
92         Qsf/lOh0Ku7O+VdBa+BwVPuUkSw6wTY5Ku1y/6r1BQzJ9oHkryDDJXsHzKhpdyFc
93         /lD4hNGqRkiNg5ulwAI0O1eqffPWDmeR9ZzSsqM40f1U4TNLfPAu1viWxwCgnbWz
94         onY6RqSYlRsDQaPsNTwieVEEAJeX2FGgNepD1SvfEremAkWCrYYlSZI76iTIf6bd
95         kGkWqIT0vJyE2MNenhDJ2ebbHJVFmL9x8S3m1daC4Zwnacm7aoCY/QgMJ+Js1Fex
96         Acev48W9KHgpVbFMd1t8KAwRbmFcQf0C/FZUbE7xScpTxS4z3SsMOuRyfnGpDOi6
97         m/SnA/9wpquf3pPwbPykzKWNJEDouiJgt0zaFLauKDPeyTWeJ6htaAPDglArewdq
98         bJ9M8QgLFtzjhg/fBQlRRUk7YP4OYtp1OdPkg2D/1rPQNySWlDf21T3N/K8ydKhR
99         bYi+AsPuJLQUi3d+lVTFOebaL9felePvDC2/Eod7PSD1/rnkZ7Q0QmFja3BvcnRz
100         Lm9yZyBBcmNoaXZlIEtleSA8ZnRwLW1hc3RlckBiYWNrcG9ydHMub3JnPohGBBAR
101         AgAGBQJDgImkAAoJEHFe1qB+e4rJ2x4An2oI4xJpDvOx8uDIo9ihG1M0MpUqAJ9S
102         cqVUmiyYSPtu8MwcZecy9kmOIYheBBMRAgAeBQJDCIMOAhsDBgsJCAcDAgMVAgMD
103         FgIBAh4BAheAAAoJEOqOiyEWuhNsDt4AniaEBvlr4oVFMrGgPiye7iE/jv68AJ48
104         OkIfwcKJt7N8ImPAboeimFvWgIheBBMRAgAeBQJDCIMOAhsDBgsJCAcDAgMVAgMD
105         FgIBAh4BAheAAAoJEOqOiyEWuhNsDt4AnjdB14rGa/rzz1ohwsi1oEnDRYuyAJ44
106         Nv8MTPjOaeEZArQ0flg8OXwF34hGBBARAgAGBQJEeI+KAAoJEHvDNTBle/A9pDwA
107         mwVpbaoH1hebV4MgXIpRvTQiL2keAJ9ryd2LvhbPd5EZM1C3Nsar2/2CgIhGBBAR
108         AgAGBQJHE7HYAAoJEGvFvIY3KyPVlwEAoJyGuJ/SsJTlyIVbulWYp3U/uZQTAJ4l
109         40SrE/wwDeSIrhWNkmmNPbnz54hGBBARAgAGBQJHKneLAAoJEBRrPPJWJbOATcsA
110         n3I8y3pJN6jkmnhUQepfa7jJoDY2AKClHVXYuNZpc2jZKyruwgwck+jCabkCDQRD
111         CIMREAgAzXu6DGSDAz4JH+mlthtiQwNZFU8bjWanGT3DL6zubxwc3ZQmRaMOiVuv
112         JUuaJv8fdGRSvp09dP2/x5mzq2rACiEnDwZssNSK5sigxgy2W9zeO9bOtg6bhqZL
113         wlsL8Y2xZhyGL3qGeP4zL1QbXZ1QdJuO90Xu7GWYS6Wsj+Y6dUsZFYvTZwSiLkEm
114         gFUTxkNue3DQtZ/KNkwoKc+aqU+S7gDNStQDvTNtR6IV11KbKcY1iQ0B2bkh4zSh
115         WwloIr83V6huAhfH8GA7UW6saRJAof5DJWUb+PRmU2TAOOlyZoM4nMH+sFFDPOeG
116         8fbecwlox5BRTMqcCB5ELbQXoVZT+wADBQf/ffI9R53f9USQkhsSak+k82JjRo9h
117         qKAvPwBv3fDhMYqX3XRmwgNeax2y6Ub0AQkDhIC6eJILP5hTb2gjpmYYP7YE/7F1
118         h37lUg7dDYeyPQF54mUXPnIg3uQ/V9HBTY+ZW8rsVe1KRvPAuVFU77FfCvIFdLSX
119         Vi1HSUcGv9Y7Kk4Tkr7vzKshlcIp6zZrO0Y3t/+ekBwTTQqEoUylVYkCSt3z6bjp
120         VWbepkL88rbqJnPueTATw9shjbFYaND8cXZox9tQmlOIZ6gDeH1YvFf7ObRLxULm
121         7C6hwik6agtXWkNABVXSxM6MB4hcP9QC+FEhK6y/7wC3SyNRBuFujDG1aohJBBgR
122         AgAJBQJDCIMRAhsMAAoJEOqOiyEWuhNsVVMAoJ1gbL0PHVf7yDwMjO3HuJBErxLd
123         AJ4v9ojJnvJu2yUl4W586soBm+wsLg==
124         =n4L0
125         -----END PGP PUBLIC KEY BLOCK-----
126         EOF
127
128
129 update apt list
130
131         apt-get update
132
133
134 upgrade
135
136         apt-get install locales-all
137
138
139 rest follows
140
141         apt-get dist-upgrade
142
143
144 reject changes to /etc/pam.d/sudo (puppet will install a new file later anyway)
145
146 merge changes into /etc/munin/plugin-conf.d/munin-node (change new and accept (A)):
147
148         sed -i -e 's/adm$/adm, maillog/' /etc/munin/plugin-conf.d/munin-node.dpkg-new
149
150  * keep local (i.e. reject (N)):
151   * all changes relating to exim  (in /etc/exim4 and in logrotate)
152   * /etc/ldap/ldap.conf
153   * /etc/nagios/nrpe.cfg
154   * /etc/samhain/samhainrc
155   * /etc/munin/munin-node.conf
156  * merge: /etc/logrotate.d/apache2
157  * take new: /etc/apache2/apache2.conf
158  * maybe take new: /etc/apache2/ports.conf
159  * change ServerTokens from "Full" to "ProductOnly" in /etc/apache2/conf.d/security
160
161
162 update nagios on samosa  (add host to lenny hostgroup)
163
164 maybe install [[puppet|puppet-setup]]
165
166 check for obsolete packages
167
168         /usr/lib/nagios/plugins/dsa-check-packages
169
170 clean up old libs
171
172         orphaner
173         orphaner -n
174         orphaner -a
175         orphaner -a -n
176
177
178 purge removed packages
179
180         dpkg --get-selections | awk '$2!="install" {print $1}'
181         echo "really purge these [y/N]?"; read ans; [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2!="install" {print $1}'`
182
183 possibly reboot
184
185 re-enable exim
186
187         mv /etc/rc2.d/K20exim4 /etc/rc2.d/S20exim4
188         env -i /etc/init.d/exim4 start