Remove backports again when puppet resets our sources back to stretch
[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         sed -i "/backports/d" /etc/apt/sources.list.d/debian.list &&
34         apt-get update &&
35         apt-get dist-upgrade &&
36         apt-get --purge autoremove &&
37         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done &&
38         dpkg --clear-avail &&
39         apt-get clean
40
41 purge removed packages
42
43         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
44         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
45         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
46
47 more clean ups:
48
49         apt-get update &&
50         /usr/lib/nagios/plugins/dsa-check-packages | tr -d ,
51
52         (apt-get purge them)
53
54         apt-get --purge autoremove &&
55         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done
56
57         (puppet agent -t || true) && (puppet agent -t || true)
58
59 update dsa-nagios.git (add host to buster hostgroup)
60
61 re-init samhain and finish with a reboot
62
63         (puppet agent -t || true) &&
64         (puppet agent -t || true) &&
65         (puppet agent -t || true) &&
66         samhain --foreground -t update -p none -s none -l none -m none &&
67         dsa-update-apt-status -f &&
68         reboot < /dev/null
69
70 consider more cleanup
71
72         apt-get autoremove &&
73         (puppet agent -t || true) &&
74         samhain --foreground -t update -p none -s none -l none -m none &&
75         dsa-update-apt-status -f
76