Do not install the linux-image-amd64 meta-package
[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 &&
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 purge removed packages
40
41         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
42         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
43         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
44
45 more clean ups:
46
47         apt-get update &&
48         /usr/lib/nagios/plugins/dsa-check-packages | tr -d ,
49
50         (apt-get purge them)
51
52         apt-get --purge autoremove &&
53         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done
54
55         (puppet agent -t || true) && (puppet agent -t || true)
56
57 update dsa-nagios.git (add host to buster hostgroup)
58
59 re-init samhain and finish with a reboot
60
61         (puppet agent -t || true) &&
62         (puppet agent -t || true) &&
63         (puppet agent -t || true) &&
64         samhain --foreground -t update -p none -s none -l none -m none &&
65         dsa-update-apt-status -f &&
66         reboot < /dev/null
67
68 consider more cleanup
69
70         apt-get autoremove &&
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