Ostatnio aktywny 6 months ago

Rewizja 2d30dbf5e30d7e76bc963d769779d9759bf31503

lenny2squeeze.sh Surowy
1Please also refer to http://www.debian.org/releases/lenny/releasenotes and use your brain!
2
3# http://www.debian.org/releases/squeeze/i386/release-notes/ch-upgrading.de.html#purge-splashy
4aptitude purge splashy
5
6# change distro
7sed -i s/lenny-restricted/restricted/g /etc/apt/sources.list
8sed -i s/lenny/squeeze/g /etc/apt/sources.list
9sed -i "s/ stable/ squeeze/g" /etc/apt/sources.list
10sed -i s/lenny/squeeze/g /etc/apt/preferences
11sed -i /proposed-updates/d /etc/apt/sources.list
12sed -i /volatile/d /etc/apt/sources.list
13sed -i /etch/d /etc/apt/sources.list
14sed -i s#/backports.org/debian#/ftp.de.debian.org/debian-backports#g /etc/apt/sources.list
15echo -e "\n#" >> /etc/apt/sources.list && \
16echo "# squeeze-updates" >> /etc/apt/sources.list && \
17echo "#" >> /etc/apt/sources.list && \
18echo -e "deb\thttp://debian.tmt.de/debian\tsqueeze-updates\tmain" >> \
19/etc/apt/sources.list
20aptitude update
21
22# check package status
23dpkg --audit
24aptitude search "~ahold" | grep "^.h"
25dpkg --get-selections | grep hold
26
27# unmark packages auto
28aptitude unmarkauto vim
29aptitude unmarkauto $(dpkg-query -W 'linux-image-2.6.*' | cut -f1)
30
31# have a look into required and free disk space
32apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h
33
34# record session
35script -t 2>~/upgrade-squeeze.time -a ~/upgrade-squeeze.script
36
37# update aptitude first
38#aptitude install aptitude
39
40# converting auto packages from aptitude to apt with any aptitude command
41#aptitude search "?false"
42
43# minimal system upgrade
44aptitude upgrade
45
46
47
48# disable to bind mysql to localhost (from etch -> lenny migrtation)
49# echo -e "[mysqld]\nbind-address = 0.0.0.0" > /etc/mysql/conf.d/bind.cnf
50
51# phpmyadmin
52echo "create database phpmyadmin" | mysql -p
53sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" /etc/phpmyadmin/config.inc.php
54sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" /etc/phpmyadmin/config.inc.php
55
56
57
58# reintroduce community
59
60sed -i "s^#rocommunity secret 10.0.0.0/16^rocommunity public^g" /etc/snmp/snmpd.conf
61sed -i s/#agentAddress/agentAddress/ /etc/snmp/snmpd.conf
62sed -i "s/agentAddress udp:127/#agentAddress udp:127/" /etc/snmp/snmpd.conf
63
64
65
66# exchange debian ntp server with german once
67sed -i "s/debian\.pool\.ntp\.org/de.pool.ntp.org/g" /etc/ntp.conf
68
69# fix pam
70sed -i "s/# auth required pam_wheel.so/auth required pam_wheel.so/" /etc/pam.d/su
71
72# maybe we want to change some shorewall config stuff again
73sed -i s/DISABLE_IPV6=Yes/DISABLE_IPV6=No/ /etc/shorewall/shorewall.conf
74sed -i s/^startup=0/startup=1/ /etc/default/shorewall
75
76
77
78# reenable mailnotification of smartmond
79sed -i "s/m root -M exec/I 194 -I 231 -I 9 -m foo@bar.org -M exec/" /etc/smartd.conf
80# for 3ware you may instead need
81echo "/dev/twa0 -d 3ware,0 -a -s (L/../../7/02|S/../.././02) -I 194 -I 231 -I 9 -m foo@bar.org -M exec /usr/share/smartmontools/smartd-runner" >> /etc/smartd.conf
82echo "/dev/twa0 -d 3ware,1 -a -s (L/../../7/03|S/../.././03) -I 194 -I 231 -I 9 -m foo@bar.org -M exec /usr/share/smartmontools/smartd-runner" >> /etc/smartd.conf
83
84
85
86# disable php expose
87echo "expose_php = Off" > /etc/php5/apache2/conf.d/expose.ini
88
89# fix proftpd
90
91sed -i s/DisplayFirstChdir/DisplayChdir/g /etc/proftpd/proftpd.conf
92sed -i s/SQLHomedirOnDemand/CreateHome/g /etc/proftpd/proftpd.conf
93/etc/init.d/proftpd restart
94
95# install kernel image
96aptitude install linux-image-2.6-flavor
97# install udev
98aptitude install udev
99
100
101
102# dist-upgrade
103aptitude dist-upgrade
104
105
106
107# install rsyslog in favor of sysklogd
108
109aptitude install rsyslog
110
111
112# remove old lenny packages left around (keep eyes open!)
113aptitude search ?obsolete
114dpkg -l | grep etch | grep -v xen | awk '{print $2}' | xargs aptitude -y purge
115dpkg -l | grep lenny | grep -v xen | grep -v linux-image | awk '{print $2}' | xargs aptitude -y purge
116aptitude -y install deborphan && deborphan | grep -v xen | grep -v libpam-cracklib | xargs aptitude -y purge
117dpkg -l | grep ^r | awk '{print $2}' | xargs aptitude -y purge
118
119# Maybe switch to dependency based boot system?
120aptitude purge libdevmapper1.02
121dpkg-reconfigure sysv-rc
122
123# migrate xen console see http://wiki.dunharg.cyconet.org/Documentation/Sniplets/Migration_from_Lenny_to_Squeeze/Enable_%2f%2fdev%2f%2fhvc_in_domU
124sed -i s/XENDOMAINS_RESTORE=true/XENDOMAINS_RESTORE=false/ /etc/default/xendomains
125sed -i s#XENDOMAINS_SAVE=/var/lib/xen/save#XENDOMAINS_SAVE=\"\"# /etc/default/xendomains
126
127
128# wenn webalizer installiert
129dpkg -l | grep webalizer && aptitude install geoip-database
130
131# Maybe fix Vhosts
132sed -i "s#/var/log/apache2#\$\{APACHE_LOG_DIR\}#g" /etc/apache2/sites-available/default
133sed -i 's/ErrorLog "|/ErrorLog "||/' /etc/apache2/sites-available/*
134
135# remove ipv6 workaround
136sed -i "/up.*modprobe.* ipv6/d" /etc/network/interfaces
137
138
139# Upgrade to Grub2?
140upgrade-from-grub-legacy