waja revised this gist 11 years ago. Go to revision
1 file changed, 4 insertions, 2 deletions
squeeze2wheezy.sh
| @@ -79,9 +79,11 @@ sed -i s/^startup=0/startup=1/ /etc/default/shorewall | |||
| 79 | 79 | aptitude dist-upgrade | |
| 80 | 80 | ||
| 81 | 81 | # migrate expose.ini | |
| 82 | - | [ -f /etc/php5/conf.d/expose.ini ] && mv /etc/php5/conf.d/expose.ini /etc/php5/mods-available/local-expose.ini && php5enmod local-expose/90 | |
| 82 | + | [ -f /etc/php5/conf.d/expose.ini ] && mv /etc/php5/conf.d/expose.ini \ | |
| 83 | + | /etc/php5/mods-available/local-expose.ini && php5enmod local-expose/90 | |
| 83 | 84 | # migrate local suhosin config | |
| 84 | - | find /etc/php5/conf.d/ -type f -name "*suhosin.ini" -exec mv '{}' /etc/php5/mods-available/local-suhosin.ini \; && php5enmod local-suhosin/90 | |
| 85 | + | find /etc/php5/conf.d/ -type f -name "*suhosin.ini" -exec mv '{}' \ | |
| 86 | + | /etc/php5/mods-available/local-suhosin.ini \; && php5enmod local-suhosin/90 | |
| 85 | 87 | ||
| 86 | 88 | # mysql | |
| 87 | 89 | ||
waja revised this gist 11 years ago. Go to revision
1 file changed, 2 insertions, 1 deletion
squeeze2wheezy.sh
| @@ -37,7 +37,8 @@ aptitude unmarkauto $(dpkg-query -W 'linux-image-2.6.*' | cut -f1) | |||
| 37 | 37 | apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h | |
| 38 | 38 | ||
| 39 | 39 | # check if we have PAE available (http://www.debian.org/releases/testing/i386/release-notes/ch-upgrading.en.html#idp573136) | |
| 40 | - | grep -q '^flags.*\bpae\b' /proc/cpuinfo && echo "We support PAE: yes" || echo "We support PAE: no (please install linux-image-486 and remove linux-image-.*-686)" | |
| 40 | + | grep -q '^flags.*\bpae\b' /proc/cpuinfo && echo "We support PAE: yes" \ | |
| 41 | + | || echo "We support PAE: no (please install linux-image-486 and remove linux-image-.*-686)" | |
| 41 | 42 | ||
| 42 | 43 | # record session | |
| 43 | 44 | script -t 2>~/upgrade-wheezy.time -a ~/upgrade-wheezy.script | |
waja revised this gist 11 years ago. Go to revision
1 file changed, 5 insertions, 6 deletions
squeeze2wheezy.sh
| @@ -1,8 +1,8 @@ | |||
| 1 | 1 | Please also refer to http://www.debian.org/releases/wheezy/releasenotes and use your brain! | |
| 2 | - | For Roundcube and Sqlite Backend see: http://wiki.debian.org/Roundcube/Dep...tionOfSQLitev2 | |
| 2 | + | For Roundcube and Sqlite Backend see: http://wiki.debian.org/Roundcube/DeprecationOfSQLitev2 | |
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | - | # upgrade to UTF-8 locales (http://www.debian.org/releases/testi...ml#switch-utf8) | |
| 5 | + | # upgrade to UTF-8 locales (http://www.debian.org/releases/testing/i386/release-notes/ap-old-stuff.en.html#switch-utf8) | |
| 6 | 6 | dpkg-reconfigure locales | |
| 7 | 7 | ||
| 8 | 8 | # remove unused config file | |
| @@ -19,11 +19,10 @@ sed -i /lenny/d /etc/apt/sources.list* | |||
| 19 | 19 | sed -i s#/backports.org/debian#/ftp.de.debian.org/debian#g /etc/apt/sources.list* | |
| 20 | 20 | sed -i s/debian-backports/debian/g /etc/apt/sources.list* | |
| 21 | 21 | if [ "$( dpkg -l | grep "^ii.*php5-suhosin" | wc -l)" -ge "1" ]; then \ | |
| 22 | - | wget http://ftp.cyconet.org/debian/source...s-cyconet.list \ | |
| 22 | + | wget http://ftp.cyconet.org/debian/sources.list.d/wheezy-updates-cyconet.list \ | |
| 23 | 23 | -O /etc/apt/sources.list.d/wheezy-updates-cyconet.list | |
| 24 | 24 | fi | |
| 25 | 25 | aptitude update | |
| 26 | - | ||
| 27 | 26 | ||
| 28 | 27 | # check package status | |
| 29 | 28 | dpkg --audit | |
| @@ -37,7 +36,7 @@ aptitude unmarkauto $(dpkg-query -W 'linux-image-2.6.*' | cut -f1) | |||
| 37 | 36 | # have a look into required and free disk space | |
| 38 | 37 | apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h | |
| 39 | 38 | ||
| 40 | - | # check if we have PAE available (http://www.debian.org/releases/testi...html#idp573136) | |
| 39 | + | # check if we have PAE available (http://www.debian.org/releases/testing/i386/release-notes/ch-upgrading.en.html#idp573136) | |
| 41 | 40 | grep -q '^flags.*\bpae\b' /proc/cpuinfo && echo "We support PAE: yes" || echo "We support PAE: no (please install linux-image-486 and remove linux-image-.*-686)" | |
| 42 | 41 | ||
| 43 | 42 | # record session | |
| @@ -99,4 +98,4 @@ dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '{prin | |||
| 99 | 98 | dpkg -l | grep lenny | grep -v xen | awk '{print $2}' | xargs aptitude -y purge | |
| 100 | 99 | dpkg -l | grep squeeze | grep -v xen | grep -v linux-image | awk '{print $2}' | xargs aptitude -y purge | |
| 101 | 100 | aptitude -y install deborphan && deborphan | grep -v xen | grep -v libpam-cracklib | xargs aptitude -y purge | |
| 102 | - | dpkg -l | grep ^r | awk '{print $2}' | xargs aptitude -y purge | |
| 101 | + | dpkg -l | grep ^r | awk '{print $2}' | xargs aptitude -y purge | |
waja revised this gist 11 years ago. Go to revision
1 file changed, 102 insertions
squeeze2wheezy.sh(file created)
| @@ -0,0 +1,102 @@ | |||
| 1 | + | Please also refer to http://www.debian.org/releases/wheezy/releasenotes and use your brain! | |
| 2 | + | For Roundcube and Sqlite Backend see: http://wiki.debian.org/Roundcube/Dep...tionOfSQLitev2 | |
| 3 | + | ||
| 4 | + | ||
| 5 | + | # upgrade to UTF-8 locales (http://www.debian.org/releases/testi...ml#switch-utf8) | |
| 6 | + | dpkg-reconfigure locales | |
| 7 | + | ||
| 8 | + | # remove unused config file | |
| 9 | + | rm -rf /etc/network/options /etc/environment | |
| 10 | + | ||
| 11 | + | # change distro (please move 3rd party sources to /etc/apt/sources.list.d/) | |
| 12 | + | sed -i s/squeeze/wheezy/g /etc/apt/sources.list* | |
| 13 | + | sed -i "s/ stable/ wheezy/g" /etc/apt/sources.list* | |
| 14 | + | sed -i s/squeeze/wheezy/g /etc/apt/preferences* | |
| 15 | + | sed -i /proposed-updates/d /etc/apt/sources.list* | |
| 16 | + | sed -i /volatile/d /etc/apt/sources.list* | |
| 17 | + | sed -i /etch/d /etc/apt/sources.list* | |
| 18 | + | sed -i /lenny/d /etc/apt/sources.list* | |
| 19 | + | sed -i s#/backports.org/debian#/ftp.de.debian.org/debian#g /etc/apt/sources.list* | |
| 20 | + | sed -i s/debian-backports/debian/g /etc/apt/sources.list* | |
| 21 | + | if [ "$( dpkg -l | grep "^ii.*php5-suhosin" | wc -l)" -ge "1" ]; then \ | |
| 22 | + | wget http://ftp.cyconet.org/debian/source...s-cyconet.list \ | |
| 23 | + | -O /etc/apt/sources.list.d/wheezy-updates-cyconet.list | |
| 24 | + | fi | |
| 25 | + | aptitude update | |
| 26 | + | ||
| 27 | + | ||
| 28 | + | # check package status | |
| 29 | + | dpkg --audit | |
| 30 | + | aptitude search "~ahold" | grep "^.h" | |
| 31 | + | dpkg --get-selections | grep hold | |
| 32 | + | ||
| 33 | + | # unmark packages auto | |
| 34 | + | aptitude unmarkauto vim | |
| 35 | + | aptitude unmarkauto $(dpkg-query -W 'linux-image-2.6.*' | cut -f1) | |
| 36 | + | ||
| 37 | + | # have a look into required and free disk space | |
| 38 | + | apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h | |
| 39 | + | ||
| 40 | + | # check if we have PAE available (http://www.debian.org/releases/testi...html#idp573136) | |
| 41 | + | grep -q '^flags.*\bpae\b' /proc/cpuinfo && echo "We support PAE: yes" || echo "We support PAE: no (please install linux-image-486 and remove linux-image-.*-686)" | |
| 42 | + | ||
| 43 | + | # record session | |
| 44 | + | script -t 2>~/upgrade-wheezy.time -a ~/upgrade-wheezy.script | |
| 45 | + | ||
| 46 | + | # install our preseed so libc doesn't whine | |
| 47 | + | cat > /tmp/wheezy.preseed <<EOF | |
| 48 | + | libc6 glibc/upgrade boolean true | |
| 49 | + | libc6 glibc/restart-services string | |
| 50 | + | libc6 libraries/restart-without-asking boolean true | |
| 51 | + | EOF | |
| 52 | + | /usr/bin/debconf-set-selections /tmp/wheezy.preseed | |
| 53 | + | ||
| 54 | + | # minimal system upgrade | |
| 55 | + | aptitude upgrade | |
| 56 | + | ||
| 57 | + | # randomize crontab | |
| 58 | + | sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' /etc/crontab | |
| 59 | + | sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' /etc/crontab | |
| 60 | + | ||
| 61 | + | # phpmyadmin | |
| 62 | + | sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" /etc/phpmyadmin/config.inc.php | |
| 63 | + | sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" /etc/phpmyadmin/config.inc.php | |
| 64 | + | ||
| 65 | + | # remove anonymous mysql access | |
| 66 | + | 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;" | |
| 67 | + | ||
| 68 | + | # xen | |
| 69 | + | /bin/sed -i -e 's/^[# ]*\((dom0-min-mem\).*\().*\)$/\1 512\2/' /etc/xen/xend-config.sxp | |
| 70 | + | sed -i s/XENDOMAINS_RESTORE=true/XENDOMAINS_RESTORE=false/ /etc/default/xendomains | |
| 71 | + | sed -i s#XENDOMAINS_SAVE=/var/lib/xen/save#XENDOMAINS_SAVE=\"\"# /etc/default/xendomains | |
| 72 | + | mv /etc/grub.d/20_linux_xen /etc/grub.d/09_linux_xen | |
| 73 | + | echo 'GRUB_CMDLINE_XEN="dom0_mem=512M"' >> /etc/default/grub | |
| 74 | + | ||
| 75 | + | # maybe we want to change some shorewall config stuff again | |
| 76 | + | sed -i s/^startup=0/startup=1/ /etc/default/shorewall | |
| 77 | + | ||
| 78 | + | # dist-upgrade | |
| 79 | + | aptitude dist-upgrade | |
| 80 | + | ||
| 81 | + | # migrate expose.ini | |
| 82 | + | [ -f /etc/php5/conf.d/expose.ini ] && mv /etc/php5/conf.d/expose.ini /etc/php5/mods-available/local-expose.ini && php5enmod local-expose/90 | |
| 83 | + | # migrate local suhosin config | |
| 84 | + | find /etc/php5/conf.d/ -type f -name "*suhosin.ini" -exec mv '{}' /etc/php5/mods-available/local-suhosin.ini \; && php5enmod local-suhosin/90 | |
| 85 | + | ||
| 86 | + | # mysql | |
| 87 | + | ||
| 88 | + | # vsftpd and chroot_local_user? | |
| 89 | + | if [ "$(grep -i ^chroot_local_user=yes /etc/vsftpd.conf | wc -l)" -ge "1" ]; then \ | |
| 90 | + | echo "deb http://ftp.cyconet.org/debian wheezy-updates main non-free contrib" >> /etc/apt/sources.list.d/wheezy-updates-cyconet.list; \ | |
| 91 | + | aptitude update; aptitude install -t wheezy-updates vsftpd && \ | |
| 92 | + | echo "allow_writeable_chroot=YES" >> /etc/vsftpd.conf && /etc/init.d/vsftpd restart; \ | |
| 93 | + | fi | |
| 94 | + | ||
| 95 | + | # remove old squeeze packages left around (keep eyes open!) | |
| 96 | + | apt-get autoremove | |
| 97 | + | aptitude search ?obsolete | |
| 98 | + | dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '{print $2}' | xargs aptitude -y purge | |
| 99 | + | dpkg -l | grep lenny | grep -v xen | awk '{print $2}' | xargs aptitude -y purge | |
| 100 | + | dpkg -l | grep squeeze | grep -v xen | grep -v linux-image | awk '{print $2}' | xargs aptitude -y purge | |
| 101 | + | aptitude -y install deborphan && deborphan | grep -v xen | grep -v libpam-cracklib | xargs aptitude -y purge | |
| 102 | + | dpkg -l | grep ^r | awk '{print $2}' | xargs aptitude -y purge | |