minor updates to upgrade proc
[mirror/dsa-wiki.git] / input / howto / upgrade-to-stretch.mdwn
1 # Upgrade from jessie to stretch:
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 on IRC if it's a
5 general developer box.
6
7 upgrade stuff:
8
9 * answer question to libc6 "Restart services automaticaly" with "yes"
10 * say no to other other questions.
11
12 commands:
13
14         sed -i "s#jessie#stretch#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
15         dpkg --clear-avail &&
16         if [ -e /etc/apt/sources.list.d/buildd.debian.org.list ]; then
17                 sed -i "s#jessie#stretch#g" /etc/apt/sources.list.d/buildd.debian.org.list
18         fi &&
19         apt-get update &&
20         service samhain stop &&
21         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
22         apt-get install dpkg apt samhain linux-image-amd64 &&
23         service samhain stop &&
24         apt-get dist-upgrade &&
25         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
26         samhain --foreground -t init -p none -s none -l none -m none &&
27         (puppet agent -t || true) &&
28         : sometimes puppet resets our sources back to jessie.  insist &&
29         sed -i "s#jessie#stretch#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
30         apt-get update &&
31         apt-get dist-upgrade &&
32         : Only try to purge packages that are installed, else apt gets angry &&
33         apt-get purge $(for i in libssl1.0.0:amd64 gcc-4.9-base:amd64 gcc-4.8-base:amd64 libapt-pkg4.12:amd64 libreadline6:amd64  libprocps3:amd64 sp libsp1c2 libaugeas-ruby1.8 libreadline6:arm64 gcc-4.9-base:arm64 gcc-4.8-base:arm64 libruby2.1:arm64 ruby2.1 libssl1.0.0:arm64 libaugeas-ruby sysvinit libxtables10; do dpkg -l "$i" 2>/dev/null | grep -q '^ii' && echo "$i"; done) &&
34         (puppet agent -t || true) &&
35         apt-get --purge autoremove &&
36         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done &&
37         dpkg --clear-avail &&
38         apt-get clean
39
40 on amd64, install kernel:
41
42         apt-get install linux-image-amd64
43
44 purge removed packages
45
46         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
47         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
48         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
49
50 more clean ups:
51
52         /usr/lib/nagios/plugins/dsa-check-packages | tr -d ,
53
54         (apt-get purge them)
55
56         apt-get --purge autoremove &&
57         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done
58
59         (puppet agent -t || true) && (puppet agent -t || true)
60
61 On HP servers, add nopat to GRUB_CMDLINE_LINUX in /etc/default/grub. ** This should now be done by puppet.  If not, check why not.  (in grub.d)
62
63 On ppc64el (only VMs?) the network interface has been renamed from ethX to ibmvethX. Change /etc/network/interfaces accordingly.
64
65 update dsa-nagios.git (add host to stretch hostgroup)
66
67 re-init samhain and finish with a reboot
68
69         (puppet agent -t || true) &&
70         (puppet agent -t || true) &&
71         (puppet agent -t || true) &&
72         samhain --foreground -t update -p none -s none -l none -m none &&
73         dsa-update-apt-status -f &&
74         reboot < /dev/null
75
76 consider more cleanup
77
78         apt-get autoremove &&
79         (puppet agent -t || true) &&
80         samhain --foreground -t update -p none -s none -l none -m none &&
81         dsa-update-apt-status -f
82