c783ad439e0697716f7428166daf843e076ff6f6
[mirror/dsa-wiki.git] / input / howto / upgrade-to-jessie.mdwn
1 # Upgrade from squeeze to wheezy
2
3 Make sure to coordinate with whoever uses the host, be it the buildd
4 operator, the QA team, the ftp team or just announce it if it's a
5 general developer box.
6
7 on buildds:
8
9         buildds want moving to the new puppetized setup!
10
11 upgrade stuff:
12
13 * answer question to libc6 "Restart services automaticaly" with "yes"
14 * say no to other other questions.
15
16 commands:
17
18         sed -i "s#wheezy#jessie#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
19         dpkg --clear-avail &&
20         if [ -e /etc/apt/sources.list.d/buildd.debian.org.list ]; then
21                 sed -i "s#squeeze#wheezy#g" /etc/apt/sources.list.d/buildd.debian.org.list
22         fi &&
23         apt-get update &&
24         apt-get install dpkg apt samhain &&
25         service samhain stop &&
26         apt-get dist-upgrade &&
27         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
28         samhain --foreground -t init -p none -s none -l none -m none &&
29         (puppet agent -t || true) &&
30         apt-get dist-upgrade &&
31         apt-get purge ruby1.8 libffi5:amd64 emacs23-nox libruby1.9.1 libfilesystem-ruby1.9.1 libruby1.8 emacs23-common ruby1.9.1 emacs23-bin-common &&
32         apt-get --purge autoremove &&
33         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done &&
34         dpkg --clear-avail &&
35         apt-get clean
36
37
38 purge removed packages
39
40         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
41         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
42         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
43
44 more clean ups:
45
46         /usr/lib/nagios/plugins/dsa-check-packages | tr -d ,
47
48         (apt-get purge them)
49
50         apt-get --purge autoremove &&
51         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done
52
53         (puppet agent -t || true) && (puppet agent -t || true)
54
55 nfs kernel module fu:
56         grep '^nfs$' /etc/modules && ! grep '^nfsv4$' /etc/modules && echo nfsv4 | tee -a /etc/modules
57
58 apache cleanup:
59
60         mkdir /etc/apache2/conf.d.WHEEZY &&
61         cd /etc/apache2/conf.d &&
62           for i in *; do
63             diff -u $i ../conf-enabled/$i.conf && mv -v $i ../conf.d.WHEEZY/
64           done &&
65           cd .. &&
66           rmdir conf.d
67
68         per vhost:
69           move sites-available file to foo.conf,
70           remove dangling symlink in sites-enabled,
71           a2ensite foo
72           replace all order allow,deny, allow from all with
73             Require all granted
74
75 Add the new ed25519 ssh host key:
76         run
77           echo; echo "cat << EOF | ldapmodify -ZZ -x -D uid="\$USER",ou=users,dc=debian,dc=org -W -h db.debian.org"; echo "dn: host=`hostname`,ou=hosts,dc=debian,dc=org"; echo "changetype: modify"; echo "add: sshRSAHostKey"; echo "sshRSAHostKey: `cat /etc/ssh/ssh_host_ed25519_key.pub `"; echo; echo "EOF"; echo
78         and paste it on draghi.
79         
80 update dsa-nagios.git (add host to jessie hostgroup)
81
82 re-init samhain and finish with a reboot
83
84         (puppet agent -t || true) &&
85         (puppet agent -t || true) &&
86         samhain --foreground -t update -p none -s none -l none -m none &&
87         /sbin/reboot