waja

waja / gist:cced251f4e8c4cc886d955ff01755343

Last active 3 months ago

Like 0

Jan Wagner revised this gist 4 years ago · 0df3e97

2 files changed, 3 insertions, 195 deletions

README.md (file created)
@@ -0,0 +1,3 @@
1 + # New location
2 +
3 + Head over to https://github.com/waja/debian-update-cheatsheets/blob/buster2bullseye/buster2bullseye.sh
buster2bullseye.sh (file deleted)

Diff is too large to be shown

Jan Wagner revised this gist 4 years ago · c17a157

1 file changed, 2 insertions, 2 deletions

buster2bullseye.sh
@@ -145,8 +145,8 @@ apt remove libgcc1 && apt full-upgrade
145 145
146 146 # remove old squeeze packages left around (keep eyes open!)
147 147 apt autoremove && \
148 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|check-openmanage|check-linux-bonding|webalizer' | awk '/^i *A/ { print $3 }') && \
149 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|check-openmanage|check-linux-bonding|webalizer' | awk '/^i/ { print $2 }') && \
148 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|check-openmanage|check-linux-bonding|webalizer|icinga' | awk '/^i *A/ { print $3 }') && \
149 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|check-openmanage|check-linux-bonding|webalizer|icinga' | awk '/^i/ { print $2 }') && \
150 150 apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \
151 151 apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \
152 152 apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \

Jan Wagner revised this gist 4 years ago · 43754e2

1 file changed, 6 insertions

buster2bullseye.sh
@@ -134,6 +134,12 @@ DOCKER_VER="$(apt-cache policy docker-ce | grep debian-bullseye | head -1 | awk
134 134 # transition icingaweb2 to bullseye package
135 135 ICINGAWEB2_VER="$(apt-cache policy icingaweb2 | grep "\.bullseye" | head -1 | awk '{print $1}')" && [ -n "${ICINGAWEB2_VER}" ] && apt install icingaweb2=${ICINGAWEB2_VER} icingaweb2-common=${ICINGAWEB2_VER} icingaweb2-module-monitoring=${ICINGAWEB2_VER} php-icinga=${ICINGAWEB2_VER} icingacli=${ICINGAWEB2_VER}
136 136
137 + # transition icinga2 to bullseye packages
138 + apt-get install $(dpkg -l | grep icinga2 | grep -v common | awk '{print $2"/icinga-bullseye"}')
139 +
140 + # Mitigate #991235 (fail2ban and bsd-mailx)
141 + if [ $(dpkg -l | grep -cE "(bsd-mailx|fail2ban)") -ge 2 ]; then sed -i "s/mail -E 'set escape'/mail/g" /etc/fail2ban/action.d/mail*.conf && service fail2ban reload; fi
142 +
137 143 # Remove libgcc1 so cpp-8 can be updated
138 144 apt remove libgcc1 && apt full-upgrade
139 145

Jan Wagner revised this gist 4 years ago · 16938e3

1 file changed, 4 insertions

buster2bullseye.sh
@@ -98,6 +98,10 @@ sed -i "s/^agentaddress.*/agentaddress udp:161,udp6:[::1]:161/g" $CFG
98 98 sed -i "s/public default.*/$COMMUNITY default/g" $CFG
99 99 grep ^extend /etc/snmp/snmpd.conf >> $CFG
100 100
101 + # reintroduce our own bridge script in xen
102 + SCRIPT="$(grep ^vif.default.script /etc/xen/xl.conf)"; \
103 + if [ ${SCRIPT} ]; then sed -i "s/#\?vif.default.script=.*/$SCRIPT/g" /etc/xen/xl.conf.dpkg-new; fi
104 +
101 105 # migrate unattended-upgrades config, modify the new config to our needs and place it where it is expected.
102 106 # Keep LOCAL config if asked when upgrading (and run this snippet afterwards, when dpkg is not blocked anymore and choose 'package maintainer version' then, cause this is the one we are adjusting here)
103 107 if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.ucf-old ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old; else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi && \

Jan Wagner revised this gist 4 years ago · d628ccc

1 file changed, 3 insertions, 3 deletions

buster2bullseye.sh
@@ -87,6 +87,9 @@ sed -i "s/# auth required pam_wheel.so/auth required pam_wheel.s
87 87 # chrony update, modify the new config to our needs and place it where it is expected.
88 88 if [ ! -d /etc/chrony/conf.d/ ]; then mkdir -p /etc/chrony/conf.d/; fi; echo "pool 0.de.pool.ntp.org iburst" > /etc/chrony/conf.d/pool.conf
89 89
90 + # full-upgrade
91 + apt full-upgrade
92 +
90 93 # (re)configure snmpd
91 94 COMMUNITY="$(grep ^rocommunity /etc/snmp/snmpd.conf | cut -d" " -f2)"; \
92 95 if [ -f /etc/snmp/snmpd.conf.dpkg-new ]; then CFG=/etc/snmp/snmpd.conf.dpkg-new; \
@@ -109,9 +112,6 @@ sed -i 's#//Unattended-Upgrade::MailReport "on-change"#Unattended-Upgrade::MailR
109 112 /bin/bash /usr/bin/ucf --three-way --debconf-ok /tmp/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades && \
110 113 [ "$CFG" == "/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old" ] && mv $CFG /etc/apt/apt.conf.d/50unattended-upgrades.ucf-save
111 114
112 - # full-upgrade
113 - apt full-upgrade
114 -
115 115 # Migrate (webserver) from php7.3 to php7.4
116 116 apt install $(dpkg -l |grep php7.3 | awk '/^i/ { print $2 }' |grep -v ^php7.3-opcache |sed s/php7.3/php/)
117 117 [ -L /etc/apache2/mods-enabled/mpm_prefork.load ] && a2dismod php7.3 && a2enmod php7.4 && systemctl restart apache2; ls -la /etc/php/7.3/*/conf.d/

Jan Wagner revised this gist 4 years ago · c117455

1 file changed, 4 insertions

buster2bullseye.sh
@@ -80,6 +80,10 @@ if [ ! $(grep "^ *Port" /etc/ssh/ssh_config | tee /etc/ssh/ssh_config.d/port.con
80 80 # minimal system upgrade
81 81 apt upgrade --without-new-pkgs
82 82
83 + # (re)enable wheel
84 + if [ -f /etc/pam.d/su.dpkg-new ]; then CFG=/etc/pam.d/su.dpkg-new; else CFG=/etc/pam.d/su; fi
85 + sed -i "s/# auth required pam_wheel.so/auth required pam_wheel.so/" $CFG
86 +
83 87 # chrony update, modify the new config to our needs and place it where it is expected.
84 88 if [ ! -d /etc/chrony/conf.d/ ]; then mkdir -p /etc/chrony/conf.d/; fi; echo "pool 0.de.pool.ntp.org iburst" > /etc/chrony/conf.d/pool.conf
85 89

Jan Wagner revised this gist 4 years ago · 59bd67b

1 file changed, 1 insertion, 1 deletion

buster2bullseye.sh
@@ -78,7 +78,7 @@ if [ ! $(grep "^ *Port" /etc/ssh/ssh_config | tee /etc/ssh/ssh_config.d/port.con
78 78 [ "$(which apt)" = "/usr/bin/apt" ] && apt install apt
79 79
80 80 # minimal system upgrade
81 - apt upgrade
81 + apt upgrade --without-new-pkgs
82 82
83 83 # chrony update, modify the new config to our needs and place it where it is expected.
84 84 if [ ! -d /etc/chrony/conf.d/ ]; then mkdir -p /etc/chrony/conf.d/; fi; echo "pool 0.de.pool.ntp.org iburst" > /etc/chrony/conf.d/pool.conf

Jan Wagner revised this gist 5 years ago · e19d16e

1 file changed, 2 insertions

buster2bullseye.sh
@@ -28,6 +28,8 @@ sed -i s/buster/bullseye/g /etc/apt/sources.list*
28 28 sed -i "s/ stable/ bullseye/g" /etc/apt/sources.list*
29 29 sed -i s/buster/bullseye/g /etc/apt/preferences*
30 30 sed -i s/buster/bullseye/g /etc/apt/sources.list.d/*buster*
31 + # Fix secuity suite (https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information#security-archive)
32 + sed -i "s/bullseye\/updates/bullseye-security/" /etc/apt/sources.list*
31 33 rename.ul buster bullseye /etc/apt/sources.list.d/*buster*
32 34 rgrep --color buster /etc/apt/sources.list*
33 35 apt update

Jan Wagner revised this gist 5 years ago · a66925b

1 file changed, 1 insertion, 1 deletion

buster2bullseye.sh
@@ -99,7 +99,7 @@ sed -i 's#// "origin=Debian,codename=${distro_codename}-updates"# "o
99 99 sed -i 's#//Unattended-Upgrade::Remove-Unused-Dependencies "false"#Unattended-Upgrade::Remove-Unused-Dependencies "true"#' /tmp/50unattended-upgrades && \
100 100 sed -i 's#//Unattended-Upgrade::Automatic-Reboot "false"#Unattended-Upgrade::Automatic-Reboot "true"#' /tmp/50unattended-upgrades && \
101 101 sed -i '/codename=..distro_codename.-updates/ s#^//# #' /tmp/50unattended-upgrades && \
102 - sed -i 's#//Unattended-Upgrade::MailReport "on-change"#Unattended-Upgrade::MailReport "always"#' /tmp/50unattended-upgrades && \
102 + sed -i 's#//Unattended-Upgrade::MailReport "on-change"#Unattended-Upgrade::MailReport "on-change"#' /tmp/50unattended-upgrades && \
103 103 /bin/bash /usr/bin/ucf --three-way --debconf-ok /tmp/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades && \
104 104 [ "$CFG" == "/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old" ] && mv $CFG /etc/apt/apt.conf.d/50unattended-upgrades.ucf-save
105 105

Jan Wagner revised this gist 5 years ago · 45f8651

1 file changed, 1 insertion, 1 deletion

buster2bullseye.sh
@@ -86,7 +86,7 @@ COMMUNITY="$(grep ^rocommunity /etc/snmp/snmpd.conf | cut -d" " -f2)"; \
86 86 if [ -f /etc/snmp/snmpd.conf.dpkg-new ]; then CFG=/etc/snmp/snmpd.conf.dpkg-new; \
87 87 else CFG=/etc/snmp/snmpd.conf; fi
88 88 sed -i "s/^agentaddress.*/agentaddress udp:161,udp6:[::1]:161/g" $CFG
89 - sed -i "s/public default/$COMMUNITY default/g" $CFG
89 + sed -i "s/public default.*/$COMMUNITY default/g" $CFG
90 90 grep ^extend /etc/snmp/snmpd.conf >> $CFG
91 91
92 92 # migrate unattended-upgrades config, modify the new config to our needs and place it where it is expected.