1 | #!/bin/sh
|
---|
2 |
|
---|
3 | # Script to upgrade Debian Squeeze to Wheezy
|
---|
4 |
|
---|
5 | # Update current OS
|
---|
6 | apt-get update
|
---|
7 | apt-get upgrade -y
|
---|
8 | apt-get dist-upgrade
|
---|
9 | apt-get clean
|
---|
10 |
|
---|
11 | df -h
|
---|
12 | echo -e 'If diskspace is 4Gb with prod/test sites, you may have issues. Press y to continue or any other key to break.'
|
---|
13 | read confirm
|
---|
14 | if [ "$confirm" != "y" ]; then
|
---|
15 | exit 1
|
---|
16 | fi
|
---|
17 |
|
---|
18 | #
|
---|
19 | dpkg --audit
|
---|
20 | dpkg --get-selections | grep hold
|
---|
21 |
|
---|
22 | echo -e 'The above 2 should give no results. Press y to continue or any other key to break.'
|
---|
23 | read confirm
|
---|
24 | if [ "$confirm" != "y" ]; then
|
---|
25 | exit 1
|
---|
26 | fi
|
---|
27 |
|
---|
28 | echo -e 'We should see "No packages are scheduled to be installed, removed or upgraded"'
|
---|
29 | echo -e 'Use - to deselect any which are being requested'
|
---|
30 | echo -e 'g then q to exit'
|
---|
31 |
|
---|
32 | aptitude
|
---|
33 |
|
---|
34 | echo -e 'Press y to continue or any other key to break.'
|
---|
35 | read confirm
|
---|
36 | if [ "$confirm" != "y" ]; then
|
---|
37 | exit 1
|
---|
38 | fi
|
---|
39 |
|
---|
40 | # Update Sources
|
---|
41 | cat << EOF > "/etc/apt/sources.list"
|
---|
42 | deb http://http.debian.net/debian wheezy main
|
---|
43 | deb-src http://http.debian.net/debian wheezy main
|
---|
44 | deb http://security.debian.org/ wheezy/updates main
|
---|
45 | deb-src http://security.debian.org/ wheezy/updates main
|
---|
46 | EOF
|
---|
47 | apt-get update
|
---|
48 | apt-get upgrade
|
---|
49 | apt-get clean
|
---|
50 | apt-get dist-upgrade
|
---|
51 | apt-get clean
|
---|
52 | # Can't do this for Apache servers as mod_wsgi depends still (despite running 2.7.3 fine!)
|
---|
53 | apt-get remove -y python2.6-dev python2.6 python2.6-minimal python-shapely
|
---|
54 | sudo aptitude purge `dpkg --get-selections | grep deinstall | awk '{print $1}'`
|
---|
55 |
|
---|
56 | echo 'After reboot, run part2'
|
---|
57 | reboot
|
---|
58 |
|
---|
59 | # END
|
---|