Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
stretch2buster.sh
| @@ -96,7 +96,7 @@ apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |||
| 96 | 96 | apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 97 | 97 | apt purge $(dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '/^rc/ { print $2 }') && \ | |
| 98 | 98 | apt purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 99 | - | apt purge $(dpkg -l | grep -E 'deb9|stretch' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 99 | + | apt purge $(dpkg -l | grep -E 'deb9|stretch' | grep -v xen | grep -v -E 'linux-image|debian-security-support|icinga2' | awk '{ print $2 }') && \ | |
| 100 | 100 | apt -y install deborphan && apt purge $(deborphan | grep -v xen | grep -v -E 'libpam-cracklib|libapache2-mpm-itk') | |
| 101 | 101 | apt purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 102 | 102 | ||
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 7 insertions, 15 deletions
stretch2buster.sh
| @@ -65,21 +65,13 @@ if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; els | |||
| 65 | 65 | sed -i s/2.debian.pool/0.de.pool/g $CFG | |
| 66 | 66 | ||
| 67 | 67 | # migrate unattended-upgrades config | |
| 68 | - | if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.dpkg-new ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.dpkg-new; \ | |
| 69 | - | else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi | |
| 70 | - | sed -i s/stretch/buster/g $CFG | |
| 71 | - | sed -i s/crontrib/contrib/g $CFG | |
| 72 | - | sed -i "s#// If automatic reboot is enabled and needed, reboot at the specific#// Automatically reboot even if there are users currently logged in.\n//Unattended-Upgrade::Automatic-Reboot-WithUsers \"true\";\n\n// If automatic reboot is enabled and needed, reboot at the specific#" $CFG | |
| 73 | - | cat >> $CFG <<EOF | |
| 74 | - | ||
| 75 | - | // Enable logging to syslog. Default is False | |
| 76 | - | // Unattended-Upgrade::SyslogEnable "false"; | |
| 77 | - | ||
| 78 | - | // Specify syslog facility. Default is daemon | |
| 79 | - | // Unattended-Upgrade::SyslogFacility "daemon"; | |
| 80 | - | ||
| 81 | - | EOF | |
| 82 | - | ||
| 68 | + | cp /usr/share/unattended-upgrades/50unattended-upgrades /tmp/ && \ | |
| 69 | + | MAIL=$(grep ^Unattended-Upgrade::Mail /etc/apt/apt.conf.d/50unattended-upgrades | awk -F\" '{print $2}'); sed -i 's#//Unattended-Upgrade::Mail ".*";#Unattended-Upgrade::Mail "'${MAIL}'";#g' /tmp/50unattended-upgrades && \ | |
| 70 | + | TIME=$(grep ^Unattended-Upgrade::Automatic-Reboot-Time /etc/apt/apt.conf.d/50unattended-upgrades | awk -F\" '{print $2}'); if [ "${TIME}" != "" ]; then sed -i 's#//Unattended-Upgrade::Automatic-Reboot-Time "02:00"#Unattended-Upgrade::Automatic-Reboot-Time "'${TIME}'"#' /tmp/50unattended-upgrades; fi | |
| 71 | + | sed -i 's#// "origin=Debian,codename=${distro_codename}-updates"# "origin=Debian,codename=${distro_codename}-updates"#' /tmp/50unattended-upgrades && \ | |
| 72 | + | sed -i 's#//Unattended-Upgrade::Remove-Unused-Dependencies "false"#Unattended-Upgrade::Remove-Unused-Dependencies "true"#' /tmp/50unattended-upgrades && \ | |
| 73 | + | sed -i 's#//Unattended-Upgrade::Automatic-Reboot "false"#Unattended-Upgrade::Automatic-Reboot "true"#' /tmp/50unattended-upgrades && \ | |
| 74 | + | /bin/bash /usr/bin/ucf --three-way --debconf-ok /tmp/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades | |
| 83 | 75 | ||
| 84 | 76 | # Fix our ssh pub key package configuration | |
| 85 | 77 | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 5 insertions, 4 deletions
stretch2buster.sh
| @@ -80,6 +80,11 @@ cat >> $CFG <<EOF | |||
| 80 | 80 | ||
| 81 | 81 | EOF | |
| 82 | 82 | ||
| 83 | + | ||
| 84 | + | # Fix our ssh pub key package configuration | |
| 85 | + | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 86 | + | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 87 | + | ||
| 83 | 88 | ## phpmyadmin | |
| 84 | 89 | if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 85 | 90 | else CFG=/etc/phpmyadmin/config.inc.php; fi | |
| @@ -107,10 +112,6 @@ apt purge $(dpkg -l | awk '/^rc/ { print $2 }') | |||
| 107 | 112 | reboot && sleep 180; echo u > /proc/sysrq-trigger ; sleep 2 ; echo s > /proc/sysrq-trigger ; sleep 2 ; echo b > /proc/sysrq-trigger | |
| 108 | 113 | ||
| 109 | 114 | ### not needed until now | |
| 110 | - | # Fix our ssh pub key package configuration | |
| 111 | - | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 112 | - | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 113 | - | ||
| 114 | 115 | # Upgrade postgres | |
| 115 | 116 | # See also https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.de.html#plperl | |
| 116 | 117 | if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" ]; then \ | |
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 1 deletion
stretch2buster.sh
| @@ -14,7 +14,6 @@ aptitude search '~i(!~ODebian)' | |||
| 14 | 14 | rgrep --color "deb ftp" /etc/apt/sources.list* | |
| 15 | 15 | ||
| 16 | 16 | # Transition and remove entries from older releases | |
| 17 | - | sed -i /etch/d /etc/apt/sources.list* | |
| 18 | 17 | sed -i /lenny/d /etc/apt/sources.list* | |
| 19 | 18 | sed -i /sarge/d /etc/apt/sources.list* | |
| 20 | 19 | sed -i /squeeze/d /etc/apt/sources.list* | |
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 3 deletions
stretch2buster.sh
| @@ -7,9 +7,6 @@ dpkg-reconfigure locales | |||
| 7 | 7 | # remove unused config file | |
| 8 | 8 | rm -rf /etc/network/options /etc/environment | |
| 9 | 9 | ||
| 10 | - | # migrate over to systemd (before the upgrade) / you might want reboot if you install systemd | |
| 11 | - | aptitude install systemd systemd-sysv libpam-systemd | |
| 12 | - | ||
| 13 | 10 | # are there 3rd party packages installed? (https://www.debian.org/releases/buster/amd64/release-notes/ch-upgrading.de.html#system-status) | |
| 14 | 11 | aptitude search '~i(!~ODebian)' | |
| 15 | 12 | ||
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 19 insertions, 87 deletions
stretch2buster.sh
| @@ -42,8 +42,7 @@ dpkg --get-selections | grep hold | |||
| 42 | 42 | # unmark packages auto | |
| 43 | 43 | aptitude unmarkauto vim net-tools && \ | |
| 44 | 44 | aptitude unmarkauto libapache2-mpm-itk && \ | |
| 45 | - | aptitude unmarkauto monitoring-plugins-standard monitoring-plugins-common monitoring-plugins-basic && \ | |
| 46 | - | aptitude unmarkauto $(dpkg-query -W 'linux-image-3.16*' | cut -f1) | |
| 45 | + | aptitude unmarkauto $(dpkg-query -W 'linux-image-4.9.0*' | cut -f1) | |
| 47 | 46 | ||
| 48 | 47 | # have a look into required and free disk space | |
| 49 | 48 | apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h | |
| @@ -59,20 +58,12 @@ libc6 libraries/restart-without-asking boolean true | |||
| 59 | 58 | EOF | |
| 60 | 59 | /usr/bin/debconf-set-selections /tmp/stretch.preseed | |
| 61 | 60 | ||
| 62 | - | # Disable loading defaults.vim | |
| 63 | - | echo '" disable the loading of defaults.vim' >> /etc/vim/vimrc.local | |
| 64 | - | echo "let g:skip_defaults_vim = 1" >> /etc/vim/vimrc.local | |
| 65 | - | ||
| 66 | 61 | # update aptitude first | |
| 67 | 62 | [ "$(which aptitude)" = "/usr/bin/aptitude" ] && aptitude install aptitude | |
| 68 | 63 | ||
| 69 | - | # minimal system upgrade (keep sysvinit / see http://noone.org/talks/debian-ohne-systemd/debian-ohne-systemd-clt.html#%2811%29) | |
| 64 | + | # minimal system upgrade | |
| 70 | 65 | aptitude upgrade | |
| 71 | 66 | ||
| 72 | - | ## fix our xen modification | |
| 73 | - | #rm -rf /etc/grub.d/09_linux_xen | |
| 74 | - | #dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen | |
| 75 | - | ||
| 76 | 67 | # chrony update | |
| 77 | 68 | if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi | |
| 78 | 69 | sed -i s/2.debian.pool/0.de.pool/g $CFG | |
| @@ -93,69 +84,15 @@ cat >> $CFG <<EOF | |||
| 93 | 84 | ||
| 94 | 85 | EOF | |
| 95 | 86 | ||
| 96 | - | # dnsmasq config dir | |
| 97 | - | if [ -f /etc/dnsmasq.conf.dpkg-new ]; then CFG=/etc/dnsmasq.conf.dpkg-new; \ | |
| 98 | - | else CFG=/etc/dnsmasq.conf; fi | |
| 99 | - | sed -i "s%^#conf-dir=/etc/dnsmasq.d/%conf-dir=/etc/dnsmasq.d/%" $CFG | |
| 100 | - | ||
| 101 | 87 | ## phpmyadmin | |
| 102 | 88 | if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 103 | 89 | else CFG=/etc/phpmyadmin/config.inc.php; fi | |
| 104 | 90 | sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG | |
| 105 | 91 | sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG | |
| 106 | 92 | ||
| 107 | - | # Move configs from MySQl to MariaDB config location (e.g.) | |
| 108 | - | mv /etc/mysql/conf.d/bind.cnf /etc/mysql/mariadb.conf.d/90-bind.cnf | |
| 109 | - | # In some cases the upgrade of databases seems not work out (problems with mysql.proc) | |
| 110 | - | mysql_upgrade -f -p | |
| 111 | - | # have look into https://mariadb.com/kb/en/the-mariadb-library/moving-from-mysql-to-mariadb-in-debian-9/#configuration-options-for-advanced-database-users | |
| 112 | - | ||
| 113 | - | # maybe we want to change some shorewall config stuff again | |
| 114 | - | # shorewall needs to be enabled via systemctl, /etc/default is not used by systemd | |
| 115 | - | systemctl enable shorewall | |
| 116 | - | ||
| 117 | 93 | # full-upgrade | |
| 118 | 94 | apt-get dist-upgrade | |
| 119 | 95 | ||
| 120 | - | # Migrate php5 packages over to php meta packages | |
| 121 | - | apt install $(dpkg -l |grep php5 | awk '/^i/ { print $2 }' |grep -v ^php5$ |sed s/php5/php/) | |
| 122 | - | # Fix IfModule mod_php5 in apache2 vHosts | |
| 123 | - | sed -i "s/IfModule mod_php5/IfModule mod_php7/g" /etc/apache2/sites-available/* | |
| 124 | - | # are there config needed to me migrated over to php my hand? | |
| 125 | - | ls -la /etc/php5/{apache2,cli}/conf.d/ | |
| 126 | - | a2dismod php5; a2enmod php7.0 && systemctl restart apache2 | |
| 127 | - | ||
| 128 | - | # Fix our ssh pub key package configuration | |
| 129 | - | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 130 | - | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 131 | - | ||
| 132 | - | # snmpd now runs as Debian-snmp user, fixing sudo config | |
| 133 | - | sed -i s/snmp/Debian-snmp/ /etc/sudoers.d/* | |
| 134 | - | ||
| 135 | - | # Upgrade postgres | |
| 136 | - | # See also https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.de.html#plperl | |
| 137 | - | if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" ]; then \ | |
| 138 | - | aptitude install postgresql-9.6 && \ | |
| 139 | - | pg_dropcluster --stop 9.6 main && \ | |
| 140 | - | /etc/init.d/postgresql stop && \ | |
| 141 | - | pg_upgradecluster -v 9.6 9.4 main && \ | |
| 142 | - | sed -i "s/^manual/auto/g" /etc/postgresql/9.6/main/start.conf && \ | |
| 143 | - | sed -i "s/^port = .*/port = 5432/" /etc/postgresql/9.6/main/postgresql.conf && \ | |
| 144 | - | sed -i "s/^shared_buffers = .*/shared_buffers = 128MB/" /etc/postgresql/9.6/main/postgresql.conf && \ | |
| 145 | - | /etc/init.d/postgresql restart; \ | |
| 146 | - | fi | |
| 147 | - | pg_dropcluster 9.4 main | |
| 148 | - | ||
| 149 | - | # Fix forbitten dovecot ssl_protocols | |
| 150 | - | sed -i "s/\!SSLv2 \!SSLv3/\!SSLv3/g" /etc/dovecot/local.conf && service dovecot restart | |
| 151 | - | ||
| 152 | - | # xen: use our own bridge script again, when we did before | |
| 153 | - | #[ $(grep "^(vif-script vif-bridge-local" /etc/xen/xend-config.sxp | wc -l) -gt 0 ] && \ | |
| 154 | - | # sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf | |
| 155 | - | ||
| 156 | - | # migrate/backup your images (before) migrating to docker overlay2 storage driver | |
| 157 | - | # umount /var/lib/docker/aufs; rm -rf /var/lib/docker/aufs | |
| 158 | - | ||
| 159 | 96 | # remove old squeeze packages left around (keep eyes open!) | |
| 160 | 97 | apt autoremove && \ | |
| 161 | 98 | apt purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \ | |
| @@ -174,25 +111,20 @@ apt purge $(dpkg -l | awk '/^rc/ { print $2 }') | |||
| 174 | 111 | reboot && sleep 180; echo u > /proc/sysrq-trigger ; sleep 2 ; echo s > /proc/sysrq-trigger ; sleep 2 ; echo b > /proc/sysrq-trigger | |
| 175 | 112 | ||
| 176 | 113 | ### not needed until now | |
| 177 | - | # mysql | |
| 178 | - | # remove anonymous mysql access | |
| 179 | - | #mysql -u root -p -e "DELETE FROM mysql.user WHERE User=''; DELETE FROM mysql.db WHERE Db='test' AND Host='%' OR Db='test\\_%' AND Host='%'; FLUSH PRIVILEGES;" | |
| 180 | - | ||
| 181 | - | # dont use iptables when creating xen vifs | |
| 182 | - | #cp /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge-local | |
| 183 | - | #sed -i "s/^ handle_iptable/ true/g" /etc/xen/scripts/vif-bridge-local | |
| 184 | - | #sed -i "s/^(vif-script vif-bridge)/(vif-script vif-bridge-local)/" /etc/xen/xend-config.sxp | |
| 185 | - | ||
| 186 | - | # xen | |
| 187 | - | #/bin/sed -i -e 's/^[# ]*\((dom0-min-mem\).*\().*\)$/\1 512\2/' /etc/xen/xend-config.sxp | |
| 188 | - | #sed -i s/XENDOMAINS_RESTORE=true/XENDOMAINS_RESTORE=false/ /etc/default/xendomains | |
| 189 | - | #sed -i s#XENDOMAINS_SAVE=/var/lib/xen/save#XENDOMAINS_SAVE=\"\"# /etc/default/xendomains | |
| 190 | - | #dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen | |
| 191 | - | #echo 'GRUB_CMDLINE_XEN="dom0_mem=512M"' >> /etc/default/grub | |
| 192 | - | ||
| 193 | - | # migrate expose.ini | |
| 194 | - | #[ -f /etc/php5/conf.d/expose.ini ] && mv /etc/php5/conf.d/expose.ini \ | |
| 195 | - | # /etc/php5/mods-available/local-expose.ini && php5enmod local-expose/90 | |
| 196 | - | # migrate local suhosin config | |
| 197 | - | #find /etc/php5/conf.d/ -type f -name "*suhosin.ini" -exec mv '{}' \ | |
| 198 | - | # /etc/php5/mods-available/local-suhosin.ini \; && php5enmod local-suhosin/90 | |
| 114 | + | # Fix our ssh pub key package configuration | |
| 115 | + | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 116 | + | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 117 | + | ||
| 118 | + | # Upgrade postgres | |
| 119 | + | # See also https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.de.html#plperl | |
| 120 | + | if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" ]; then \ | |
| 121 | + | aptitude install postgresql-9.6 && \ | |
| 122 | + | pg_dropcluster --stop 9.6 main && \ | |
| 123 | + | /etc/init.d/postgresql stop && \ | |
| 124 | + | pg_upgradecluster -v 9.6 9.4 main && \ | |
| 125 | + | sed -i "s/^manual/auto/g" /etc/postgresql/9.6/main/start.conf && \ | |
| 126 | + | sed -i "s/^port = .*/port = 5432/" /etc/postgresql/9.6/main/postgresql.conf && \ | |
| 127 | + | sed -i "s/^shared_buffers = .*/shared_buffers = 128MB/" /etc/postgresql/9.6/main/postgresql.conf && \ | |
| 128 | + | /etc/init.d/postgresql restart; \ | |
| 129 | + | fi | |
| 130 | + | pg_dropcluster 9.4 main | |
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 14 insertions, 12 deletions
stretch2buster.sh
| @@ -1,7 +1,7 @@ | |||
| 1 | - | Please also refer to http://www.debian.org/releases/stretch/releasenotes and use your brain! | |
| 1 | + | Please also refer to http://www.debian.org/releases/buster/releasenotes and use your brain! | |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | - | # upgrade to UTF-8 locales (http://www.debian.org/releases/stretch/amd64/release-notes/ap-old-stuff.en.html#switch-utf8) | |
| 4 | + | # upgrade to UTF-8 locales (http://www.debian.org/releases/buster/amd64/release-notes/ap-old-stuff.en.html#switch-utf8) | |
| 5 | 5 | dpkg-reconfigure locales | |
| 6 | 6 | ||
| 7 | 7 | # remove unused config file | |
| @@ -10,10 +10,10 @@ rm -rf /etc/network/options /etc/environment | |||
| 10 | 10 | # migrate over to systemd (before the upgrade) / you might want reboot if you install systemd | |
| 11 | 11 | aptitude install systemd systemd-sysv libpam-systemd | |
| 12 | 12 | ||
| 13 | - | # are there 3rd party packages installed? (https://www.debian.org/releases/stretch/amd64/release-notes/ch-upgrading.de.html#system-status) | |
| 13 | + | # are there 3rd party packages installed? (https://www.debian.org/releases/buster/amd64/release-notes/ch-upgrading.de.html#system-status) | |
| 14 | 14 | aptitude search '~i(!~ODebian)' | |
| 15 | 15 | ||
| 16 | - | # check for ftp protocol in sources lists (https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.en.html#deprecation-of-ftp-apt-mirrors) | |
| 16 | + | # check for ftp protocol in sources lists (https://www.debian.org/releases/buster/amd64/release-notes/ch-information.en.html#deprecation-of-ftp-apt-mirrors) | |
| 17 | 17 | rgrep --color "deb ftp" /etc/apt/sources.list* | |
| 18 | 18 | ||
| 19 | 19 | # Transition and remove entries from older releases | |
| @@ -22,15 +22,16 @@ sed -i /lenny/d /etc/apt/sources.list* | |||
| 22 | 22 | sed -i /sarge/d /etc/apt/sources.list* | |
| 23 | 23 | sed -i /squeeze/d /etc/apt/sources.list* | |
| 24 | 24 | sed -i /wheezy/d /etc/apt/sources.list* | |
| 25 | + | sed -i /jessie/d /etc/apt/sources.list* | |
| 25 | 26 | sed -i /volatile/d /etc/apt/sources.list* | |
| 26 | 27 | sed -i /proposed-updates/d /etc/apt/sources.list* | |
| 27 | 28 | # change distro (please move 3rd party sources to /etc/apt/sources.list.d/), maybe look into http://ftp.cyconet.org/debian/sources.list.d/ | |
| 28 | - | sed -i s/jessie/stretch/g /etc/apt/sources.list* | |
| 29 | - | sed -i "s/ stable/ stretch/g" /etc/apt/sources.list* | |
| 30 | - | sed -i s/jessie/stretch/g /etc/apt/preferences* | |
| 31 | - | sed -i s/jessie/stretch/g /etc/apt/sources.list.d/*jessie* | |
| 32 | - | rename s/jessie/stretch/g /etc/apt/sources.list.d/*jessie* | |
| 33 | - | rgrep --color jessie /etc/apt/sources.list* | |
| 29 | + | sed -i s/stretch/buster/g /etc/apt/sources.list* | |
| 30 | + | sed -i "s/ stable/ buster/g" /etc/apt/sources.list* | |
| 31 | + | sed -i s/stretch/buster/g /etc/apt/preferences* | |
| 32 | + | sed -i s/stretch/buster/g /etc/apt/sources.list.d/*stretch* | |
| 33 | + | rename s/stretch/buster/g /etc/apt/sources.list.d/*stretch* | |
| 34 | + | rgrep --color stretch /etc/apt/sources.list* | |
| 34 | 35 | apt-get update | |
| 35 | 36 | ||
| 36 | 37 | # check package status | |
| @@ -48,7 +49,7 @@ aptitude unmarkauto $(dpkg-query -W 'linux-image-3.16*' | cut -f1) | |||
| 48 | 49 | apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h | |
| 49 | 50 | ||
| 50 | 51 | # record session | |
| 51 | - | script -t 2>~/upgrade-stretch.time -a ~/upgrade-stretch.script | |
| 52 | + | script -t 2>~/upgrade-buster.time -a ~/upgrade-buster.script | |
| 52 | 53 | ||
| 53 | 54 | # install our preseed so libc doesn't whine | |
| 54 | 55 | cat > /tmp/stretch.preseed <<EOF | |
| @@ -79,7 +80,7 @@ sed -i s/2.debian.pool/0.de.pool/g $CFG | |||
| 79 | 80 | # migrate unattended-upgrades config | |
| 80 | 81 | if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.dpkg-new ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.dpkg-new; \ | |
| 81 | 82 | else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi | |
| 82 | - | sed -i s/jessie/stretch/g $CFG | |
| 83 | + | sed -i s/stretch/buster/g $CFG | |
| 83 | 84 | sed -i s/crontrib/contrib/g $CFG | |
| 84 | 85 | sed -i "s#// If automatic reboot is enabled and needed, reboot at the specific#// Automatically reboot even if there are users currently logged in.\n//Unattended-Upgrade::Automatic-Reboot-WithUsers \"true\";\n\n// If automatic reboot is enabled and needed, reboot at the specific#" $CFG | |
| 85 | 86 | cat >> $CFG <<EOF | |
| @@ -165,6 +166,7 @@ apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |||
| 165 | 166 | apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 166 | 167 | apt purge $(dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '/^rc/ { print $2 }') && \ | |
| 167 | 168 | apt purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 169 | + | apt purge $(dpkg -l | grep -E 'deb9|stretch' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 168 | 170 | apt -y install deborphan && apt purge $(deborphan | grep -v xen | grep -v -E 'libpam-cracklib|libapache2-mpm-itk') | |
| 169 | 171 | apt purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 170 | 172 | ||
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 0 insertions, 0 deletions
jessie2stretch.sh renamed to stretch2buster.sh
File renamed without changes
Jan Wagner revised this gist 7 years ago. Go to revision
1 file changed, 3 insertions
jessie2stretch.sh
| @@ -145,6 +145,9 @@ if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" | |||
| 145 | 145 | fi | |
| 146 | 146 | pg_dropcluster 9.4 main | |
| 147 | 147 | ||
| 148 | + | # Fix forbitten dovecot ssl_protocols | |
| 149 | + | sed -i "s/\!SSLv2 \!SSLv3/\!SSLv3/g" /etc/dovecot/local.conf && service dovecot restart | |
| 150 | + | ||
| 148 | 151 | # xen: use our own bridge script again, when we did before | |
| 149 | 152 | #[ $(grep "^(vif-script vif-bridge-local" /etc/xen/xend-config.sxp | wc -l) -gt 0 ] && \ | |
| 150 | 153 | # sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf | |
Jan Wagner revised this gist 8 years ago. Go to revision
1 file changed, 2 insertions, 2 deletions
jessie2stretch.sh
| @@ -155,8 +155,8 @@ pg_dropcluster 9.4 main | |||
| 155 | 155 | # remove old squeeze packages left around (keep eyes open!) | |
| 156 | 156 | apt autoremove && \ | |
| 157 | 157 | apt purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \ | |
| 158 | - | apt purge $(aptitude search ?obsolete | grep -v linux-image | awk '/^i *A/ { print $3 }') && \ | |
| 159 | - | apt purge $(aptitude search ?obsolete | grep -v linux-image | awk '/^i/ { print $2 }') && \ | |
| 158 | + | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner' | awk '/^i *A/ { print $3 }') && \ | |
| 159 | + | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner' | awk '/^i/ { print $2 }') && \ | |
| 160 | 160 | apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \ | |
| 161 | 161 | apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 162 | 162 | apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |