阿里云ECS:从Debian6(squeeze)升级到Debian7(Wheezy)

1、查看当前系统版本
root@clin003.com:~# cat /etc/issue
Debian GNU/Linux 6.0 \n \l

root@clin003.com:~# uname -a
Linux clin003.com 2.6.32-5-amd64 #1 SMP Sun Jan 1 04:57:38 CST 2012 x86_64 GNU/Linux
root@clin003.com:~#

2、修改更新源
root@clin003.com:~# nano /etc/apt/sources.list

#deb http://ftp.cn.debian.org/debian squeeze main
#deb-src http://ftp.cn.debian.org/debian squeeze main

#deb http://ftp.cn.debian.org/debian squeeze-updates main
#deb-src http://ftp.cn.debian.org/debian squeeze-updates main

#deb http://security.debian.org/ squeeze/updates main
#deb-src http://security.debian.org/ squeeze/updates main

# deb http://mirrors.aliyun.com/debian wheezy main
# deb http://mirrors.aliyuncs.com/debian wheezy main

deb http://mirrors.aliyun.com/debian wheezy main
deb http://mirrors.aliyuncs.com/debian wheezy main
deb-src http://mirrors.aliyun.com/debian wheezy main
deb-src http://mirrors.aliyuncs.com/debian wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as ‘volatile’
deb http://mirrors.aliyun.com/debian wheezy-updates main
deb http://mirrors.aliyuncs.com/debian wheezy-updates main
deb-src http://mirrors.aliyun.com/debian wheezy-updates main
deb-src http://mirrors.aliyuncs.com/debian wheezy-updates main

说明一下,“#”代表注释的意思,如果不想删除之前的源文件,可以像我这样只是注释掉之前的源地址,添加wheezy的源地址就可以了。

3、然后更新
root@clin003.com:~# apt-get update

root@clin003.com:~# apt-get -y upgrade

这中间有个等待的过程,会提示输入,按回车或空格然后按q即可。

debian6to7config

需要重启服务,我选择yes(不要再问我,该重启服务时就重启服务吧,所以建议选择在夜深人静的时候来升级)

phpmyadmin-config

由于我是用了rds,所以这里的配置phpmyadmin直接忽略掉了。
root@clin003.com:~# cat /etc/issue
Debian GNU/Linux 6.0 \n \l

root@clin003.com:~# uname -a
Linux clin003.com 2.6.32-5-amd64 #1 SMP Sun Jan 1 04:57:38 CST 2012 x86_64 GNU/Linux
root@clin003.com:~#

apt-get -y dist-upgrade

root@clin003.com:~# uname -a
Linux clin003.com 2.6.32-5-amd64 #1 SMP Sun Jan 1 04:57:38 CST 2012 x86_64 GNU/Linux
root@clin003.com:~# cat /etc/issue
Debian GNU/Linux 7 \n \l

root@clin003.com:~#

upgrade:系统将现有的Package升级,如果有相依性的问题,而此相依性需要安装其它新的
Package或影响到其它Package的相依性时,此Package就不会被升级,会保留下来.

dist-upgrade:可以聪明的解决相依性的问题,如果有相依性问题,需要安装/移除新的Package,
就会试着去安装/移除它.
(所以通常这个会被认为是有点风险的升级)

Leave a Reply

Your email address will not be published. Required fields are marked *