899186945eeb104b1e247bf973a1d5f1b2c43bfb
[mirror/dsa-wiki.git] / input / howto / upgrade-to-buster.mdwn
1 # Upgrade from stretch to buster:
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 first re-enable module loading, as new modules are needed to restart ferm (due to nftables):
13
14         sed -i "s#echo 1#echo 0#" /etc/rc.local &&
15         reboot < /dev/null
16
17 commands:
18
19         sed -i "s#stretch#buster#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
20         sed -i "/backports/d" /etc/apt/sources.list.d/debian.list &&
21         dpkg --clear-avail &&
22         apt-get update &&
23         service samhain stop &&
24         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
25         apt-get install dpkg apt samhain &&
26         service samhain stop &&
27         apt-get dist-upgrade &&
28         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
29         samhain --foreground -t init -p none -s none -l none -m none &&
30         (puppet agent -t || true) &&
31         : sometimes puppet resets our sources back to stretch.  insist &&
32         sed -i "s#stretch#buster#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
33         apt-get update &&
34         apt-get dist-upgrade &&
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 purge removed packages
41
42         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
43         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
44         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
45
46 more clean ups:
47
48         apt-get update &&
49         /usr/lib/nagios/plugins/dsa-check-packages | tr -d ,
50
51         (apt-get purge them)
52
53         apt-get --purge autoremove &&
54         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done
55
56         (puppet agent -t || true) && (puppet agent -t || true)
57
58 update dsa-nagios.git (add host to buster hostgroup)
59
60 re-init samhain and finish with a reboot
61
62         (puppet agent -t || true) &&
63         (puppet agent -t || true) &&
64         (puppet agent -t || true) &&
65         samhain --foreground -t update -p none -s none -l none -m none &&
66         dsa-update-apt-status -f &&
67         reboot < /dev/null
68
69 consider more cleanup
70
71         apt-get autoremove &&
72         (puppet agent -t || true) &&
73         samhain --foreground -t update -p none -s none -l none -m none &&
74         dsa-update-apt-status -f
75