Debian GNU/Linux支持滚动更新,出于安全方面的考虑,当新版Debian发行后,我们一般会将现有版本的Debian升级至最新的稳定版的Debian。升级除了可以提升系统的安全性以外,同时还可以获得由更新版本的应用软件带来的新功能及其它好处。这就是我们为什么要将Debian 6(Squeeze)升级至Debian 7(Wheezy)的原因。
1. 编辑/etc/apt/source.list文件
编辑/etc/apt/source.list文件,将文件中的squeeze全部换成wheezy即可,之后查看/etc/apt/source.list文件,其内容应大致如下:
1 2 3 4 5 6 7 8 9 10 | cat /etc/apt/sources.list deb http://ftp.us.debian.org/debian/ wheezy main deb-src http://ftp.us.debian.org/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://ftp.us.debian.org/debian/ wheezy-updates main deb-src http://ftp.us.debian.org/debian/ wheezy-updates main |
2.更新软件包列表
1 | apt-get update |
如果更新软件包列表时,提示:
W: There is no public key available for the following key IDs:
8B48AD6246925553
则需要导入Debian 7(Wheezy)的Archive Keys。
Debian Archive Signing Keys下载页面:http://ftp-master.debian.org/keys.html
1 2 | wget http://ftp-master.debian.org/keys/archive-key-7.0.asc apt-key add archive-key-7.0.asc |
之后重新更新软件包列表就不会提示该警告了。
1 | apt-get update |
3.更新最小化的基本系统
1 | apt-get upgrade |
4.升级剩下的系统
1 | apt-get dist-upgrade |
5.重启系统
1 | reboot |
6.验证系统
1 2 | lsb_release -a cat /etc/debian_version |
7.检查内核
1 | uname -msr |
8.删除不再需要的软件包
1 | apt-get autoremove && apt-get autoclean |