Re-enable module loading support before an upgrade to buster
[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         sed -i "s#echo 1#echo 0#" /etc/rc.local &&
14         reboot < /dev/null
15
16 commands:
17
18         sed -i "s#stretch#buster#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
19         sed -i "/backports/d" /etc/apt/sources.list.d/debian.list &&
20         dpkg --clear-avail &&
21         apt-get update &&
22         service samhain stop &&
23         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
24         apt-get install dpkg apt samhain linux-image-amd64 &&
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         : sometimes puppet resets our sources back to stretch.  insist &&
31         sed -i "s#stretch#buster#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
32         apt-get update &&
33         apt-get dist-upgrade &&
34         apt-get --purge autoremove &&
35         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done &&
36         dpkg --clear-avail &&
37         apt-get clean
38
39 on amd64, install kernel:
40
41         apt-get install linux-image-amd64
42
43 purge removed packages
44
45         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
46         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
47         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
48
49 more clean ups:
50
51         apt-get update &&
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 update dsa-nagios.git (add host to buster hostgroup)
62
63 re-init samhain and finish with a reboot
64
65         (puppet agent -t || true) &&
66         (puppet agent -t || true) &&
67         (puppet agent -t || true) &&
68         samhain --foreground -t update -p none -s none -l none -m none &&
69         dsa-update-apt-status -f &&
70         reboot < /dev/null
71
72 consider more cleanup
73
74         apt-get autoremove &&
75         (puppet agent -t || true) &&
76         samhain --foreground -t update -p none -s none -l none -m none &&
77         dsa-update-apt-status -f
78