Debian 6升级到Debian 7

Debian 6 年代实在有些久远,有些环境都支持不了。所以需要升级,这里做个记录。

一、修改源设置

编辑 /etc/apt/source.list 文件,将文件中的  squeeze 全部换成 wheezy 即可。

改完之后看起来是这样的:(阿里云主机的源是自己的镜像,和标准不太一样)

deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-proposed-updates main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-backports main contrib non-free

deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-proposed-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-backports main contrib non-free

二、更新软件包

sudo apt-get install update
sudo aptitude install update

如果出现 "There is no public key available for the following key IDs" 这样的提示,需要先执行:

sudo aptitude install debian-keyring debian-archive-keyring

三、更新系统

sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo aptitude upgrade
sudo aptitude dist-upgrade

在期间,可能会提示配置文件冲突,先用新配置覆盖,然后将自定义配置加回去(自定义配置量一般不大,更新的配置比较多)。

四、结尾工作

重启系统:sudo reboot

查看系统版本:cat /etc/debian_version