cae3d779421ed73eb44be2681d0b791579025c6d
[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 autoremove &&
32         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done &&
33         dpkg --clear-avail &&
34         apt-get clean
35
36
37 purge removed packages
38
39         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
40         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
41         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
42
43 more clean ups:
44
45         /usr/lib/nagios/plugins/dsa-check-packages | tr -d ,
46
47         (apt-get purge them)
48
49         apt-get --purge autoremove &&
50         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done
51
52         (puppet agent -t || true) && (puppet agent -t || true)
53
54 nfs kernel module fu:
55         grep '^nfs$' /etc/modules && ! grep '^nfsv4$' /etc/modules && echo nfsv4 | tee -a /etc/modules
56
57 apache cleanup:
58
59         mkdir /etc/apache2/conf.d.WHEEZY &&
60         cd /etc/apache2/conf.d &&
61           for i in *; do
62             diff -u $i ../conf-enabled/$i.conf && mv -v $i ../conf.d.WHEEZY/
63           done &&
64           cd .. &&
65           rmdir conf.d
66
67         per vhost:
68           move sites-available file to foo.conf,
69           remove dangling symlink in sites-enabled,
70           a2ensite foo
71           replace all order allow,deny, allow from all with
72             Require all granted
73
74 re-init samhain
75
76         (puppet agent -t || true) &&
77         (puppet agent -t || true) &&
78         samhain --foreground -t init -p none -s none -l none -m none
79
80 Add the new ed25519 ssh host key:
81         run
82           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
83         and paste it on draghi.
84         
85 update dsa-nagios.git (add host to jessie hostgroup)
86
87 reboot.