InstallationGuidelines/Linux/Server/CherokeePostgreSQL: upgrade-wheezy-1.sh

File upgrade-wheezy-1.sh, 1.5 KB (added by Fran Boon, 8 years ago)

Upgrade Squeeze to Wheezy

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