Disable backports before upgrading 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 commands:
13
14         sed -i "s#stretch#buster#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
15         sed -i "/backports/d" /etc/apt/sources.list.d/debian.list &&
16         dpkg --clear-avail &&
17         apt-get update &&
18         service samhain stop &&
19         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
20         apt-get install dpkg apt samhain linux-image-amd64 &&
21         service samhain stop &&
22         apt-get dist-upgrade &&
23         rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
24         samhain --foreground -t init -p none -s none -l none -m none &&
25         (puppet agent -t || true) &&
26         : sometimes puppet resets our sources back to stretch.  insist &&
27         sed -i "s#stretch#buster#g" /etc/apt/sources.list.d/debian.list /etc/apt/sources.list.d/security.list &&
28         apt-get update &&
29         apt-get dist-upgrade &&
30         apt-get --purge autoremove &&
31         while [ "$(deborphan -n | wc -l)" -gt 0 ] ; do apt-get purge $(deborphan -n); done &&
32         dpkg --clear-avail &&
33         apt-get clean
34
35 on amd64, install kernel:
36
37         apt-get install linux-image-amd64
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