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