waja

waja / gist:e518bc6006ad424b957fdd8832bb5306

Last active 3 months ago

Like 0

Jan Wagner revised this gist 4 years ago · 70f6856

2 files changed, 3 insertions, 221 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/jessie2stretch/jessie2stretch.sh
jessie2stretch.sh (file deleted)

Diff is too large to be shown

Jan Wagner revised this gist 4 years ago · bfa60eb

1 file changed, 9 insertions, 1 deletion

jessie2stretch.sh
@@ -8,7 +8,15 @@ dpkg-reconfigure locales
8 8 rm -rf /etc/network/options /etc/environment
9 9
10 10 # migrate over to systemd (before the upgrade) / you might want reboot if you install systemd
11 - aptitude install systemd systemd-sysv libpam-systemd
11 + cat > /etc/apt/sources.list.d/archive.debian.org.list<<EOF
12 + #
13 + # jessie
14 + #
15 + deb http://archive.debian.org/debian/ jessie main contrib non-free
16 + deb-src http://archive.debian.org/debian/ jessie main contrib non-free
17 + EOF
18 + aptitude update && \
19 + aptitude install systemd systemd-sysv libpam-systemd && rm /etc/apt/sources.list.d/archive.debian.org.list
12 20
13 21 # are there 3rd party packages installed? (https://www.debian.org/releases/stretch/amd64/release-notes/ch-upgrading.de.html#system-status)
14 22 aptitude search '~i(!~ODebian)'

Jan Wagner revised this gist 5 years ago · f62cf34

1 file changed, 1 insertion, 1 deletion

jessie2stretch.sh
@@ -113,7 +113,7 @@ sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][
113 113 # Move configs from MySQl to MariaDB config location (e.g.)
114 114 mv /etc/mysql/conf.d/bind.cnf /etc/mysql/mariadb.conf.d/90-bind.cnf
115 115 # In some cases the upgrade of databases seems not work out (problems with mysql.proc)
116 - mysql_upgrade -f -p
116 + source /etc/default/config-mysql-server-auth; mysql_upgrade -f --password=${MYSQLPW}
117 117 # 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
118 118
119 119 # maybe we want to change some shorewall config stuff again

Jan Wagner revised this gist 5 years ago · b055991

1 file changed, 3 insertions

jessie2stretch.sh
@@ -51,6 +51,9 @@ aptitude unmarkauto $(dpkg-query -W 'linux-image-3.16*' | cut -f1)
51 51 # have a look into required and free disk space
52 52 apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h
53 53
54 + # check for a linux-image meta package
55 + dpkg -l "linux-image*" | grep ^ii | grep -i meta || echo "Please have a look into https://www.debian.org/releases/stretch/amd64/release-notes/ch-upgrading.en.html#kernel-metapackage!"
56 +
54 57 # record session
55 58 script -t 2>~/upgrade-stretch.time -a ~/upgrade-stretch.script
56 59

Jan Wagner revised this gist 6 years ago · 3b9d927

1 file changed, 2 insertions, 2 deletions

jessie2stretch.sh
@@ -172,8 +172,8 @@ sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"
172 172 # remove old squeeze packages left around (keep eyes open!)
173 173 apt autoremove && \
174 174 apt purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \
175 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage|hp-health' | awk '/^i *A/ { print $3 }') && \
176 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage|hp-health' | awk '/^i/ { print $2 }') && \
175 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage|check-linux-bonding|hp-health' | awk '/^i *A/ { print $3 }') && \
176 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage|check-linux-bonding|hp-health' | awk '/^i/ { print $2 }') && \
177 177 apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \
178 178 apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \
179 179 apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \

Jan Wagner revised this gist 6 years ago · 6897e26

1 file changed, 1 insertion, 1 deletion

jessie2stretch.sh
@@ -125,7 +125,7 @@ CFG="/etc/default/grub"; [ $(grep GRUB_CMDLINE_LINUX ${CFG} | grep 'net.ifnames=
125 125 apt-get dist-upgrade
126 126
127 127 # Migrate php5 packages over to php meta packages
128 - apt install $(dpkg -l |grep php5 | awk '/^i/ { print $2 }' |grep -v ^php5$ |sed s/php5/php/)
128 + apt install $(dpkg -l |grep php5 | awk '/^i/ { print $2 }' |grep -v ^php5$ |sed s/php5/php/| sed s/php-sqlite/php-sqlite3/)
129 129 # Fix IfModule mod_php5 in apache2 vHosts
130 130 sed -i "s/IfModule mod_php5/IfModule mod_php7/g" /etc/apache2/sites-available/*
131 131 # are there config needed to me migrated over to php my hand?

Jan Wagner revised this gist 6 years ago · 3fc14d0

1 file changed, 2 insertions, 2 deletions

jessie2stretch.sh
@@ -172,8 +172,8 @@ sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"
172 172 # remove old squeeze packages left around (keep eyes open!)
173 173 apt autoremove && \
174 174 apt purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \
175 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage' | awk '/^i *A/ { print $3 }') && \
176 - apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage' | awk '/^i/ { print $2 }') && \
175 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage|hp-health' | awk '/^i *A/ { print $3 }') && \
176 + apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|kerio|hpacucli|check-openmanage|hp-health' | awk '/^i/ { print $2 }') && \
177 177 apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \
178 178 apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \
179 179 apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \

Jan Wagner revised this gist 6 years ago · aa3e5e7

1 file changed, 2 insertions, 2 deletions

jessie2stretch.sh
@@ -163,8 +163,8 @@ echo "/var/lib/named/** rwm," >> /etc/apparmor.d/local/usr.sbin.named && apparmo
163 163 aptitude install ruby-rmagick apache2
164 164
165 165 # xen: use our own bridge script again, when we did before
166 - #[ $(grep "^(vif-script vif-bridge-local" /etc/xen/xend-config.sxp | wc -l) -gt 0 ] && \
167 - # sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf
166 + [ $(grep '^vif.default.script="vif-bridge-local"' /etc/xen/xl.conf.dpkg-old | wc -l) -gt 0 ] && \
167 + sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf
168 168
169 169 # migrate/backup your images (before) migrating to docker overlay2 storage driver
170 170 # umount /var/lib/docker/aufs; rm -rf /var/lib/docker/aufs

Jan Wagner revised this gist 7 years ago · f4bec42

1 file changed, 6 insertions

jessie2stretch.sh
@@ -156,6 +156,12 @@ pg_dropcluster 9.4 main
156 156 # Fix forbitten dovecot ssl_protocols
157 157 sed -i "s/\!SSLv2 \!SSLv3/\!SSLv3/g" /etc/dovecot/local.conf && service dovecot restart
158 158
159 + # If you are using bind9 named and chrooted it, apparmor needs to know about it now
160 + echo "/var/lib/named/** rwm," >> /etc/apparmor.d/local/usr.sbin.named && apparmor_parser -r /etc/apparmor.d/usr.sbin.named && systemctl restart bind9
161 +
162 + # Install / Upgrade ruby-rmagick to have correct version for redmine
163 + aptitude install ruby-rmagick apache2
164 +
159 165 # xen: use our own bridge script again, when we did before
160 166 #[ $(grep "^(vif-script vif-bridge-local" /etc/xen/xend-config.sxp | wc -l) -gt 0 ] && \
161 167 # sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf

Jan Wagner revised this gist 7 years ago · 10c2aa9

1 file changed, 4 insertions

jessie2stretch.sh
@@ -117,6 +117,10 @@ mysql_upgrade -f -p
117 117 # shorewall needs to be enabled via systemctl, /etc/default is not used by systemd
118 118 systemctl enable shorewall
119 119
120 + # Work around changing network interface names after update (https://github.com/systemd/systemd/issues/8446)
121 + # Seen on VMWare guests
122 + CFG="/etc/default/grub"; [ $(grep GRUB_CMDLINE_LINUX ${CFG} | grep 'net.ifnames=0 biosdevname=0') ] || sed -i 's/\(GRUB_CMDLINE_LINUX=".*\)"/\1 net.ifnames=0 biosdevname=0"/' ${CFG} && sed -i 's/GRUB_CMDLINE_LINUX=" /GRUB_CMDLINE_LINUX="/' ${CFG} && update-grub
123 +
120 124 # full-upgrade
121 125 apt-get dist-upgrade
122 126