本方案使用update-manager来跨版本升级,请确保已经安装update-manager再执行下面的步骤。
升级需谨慎。
升级前,请卸载和删除不太必要的软件包,使系统变得相对简单干净,再升级,以减少升级耗时,和减少出错的几率。删除的包可以升级后再重新安装上。
代码: 全选
sudo gedit /etc/apt/sources.list
用#注释掉11.04的源,从论坛里面复制一个11.10的源进去。(我用的是下面的)
以下源也可供选择(替换上面所有的“http://ubuntu.srt.cn/ubuntu/”部分):#deb http://ubuntu.srt.cn/ubuntu/ natty main restricted universe multiverse
#deb http://ubuntu.srt.cn/ubuntu/ natty-security main restricted universe multiverse
#deb http://ubuntu.srt.cn/ubuntu/ natty-updates main restricted universe multiverse
#deb http://ubuntu.srt.cn/ubuntu/ natty-proposed main restricted universe multiverse
#deb http://ubuntu.srt.cn/ubuntu/ natty-backports main restricted universe multiverse
#deb-src http://ubuntu.srt.cn/ubuntu/ natty main restricted universe multiverse
#deb-src http://ubuntu.srt.cn/ubuntu/ natty-security main restricted universe multiverse
#deb-src http://ubuntu.srt.cn/ubuntu/ natty-updates main restricted universe multiverse
#deb-src http://ubuntu.srt.cn/ubuntu/ natty-proposed main restricted universe multiverse
#deb-src http://ubuntu.srt.cn/ubuntu/ natty-backports main restricted universe multiverse
#deb http://ppa.launchpad.net/wengxt/fcitx-nightly/ubuntu natty main
deb http://ubuntu.srt.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-backports main restricted universe multiverse
然后,检查/etc/apt/sources.list.d/目录下扩展名是.list的文件,把他们暂时移走(这是ppa源),防止他们影响升级。
代码: 全选
sudo apt-get update
代码: 全选
sudo apt-get -d dist-upgrade
代码: 全选
sudo update-manager -d
升级完成之后,系统会要求你重启。不急,选择不重启。为了系统下次能够正常启动,还需要进行进一步软件包检查。关闭升级窗口之后,再重复使用:
代码: 全选
sudo apt-get update
sudo apt-get upgrade
但是由于11.10处于试用状态,以上两句可能会出现错误。
在这里,如果升级过程中出现过“依赖关系损坏的包”,尽量先修复,或者删除,然后检查图形界面的包还在不在(ubuntu-desktop、kubuntu-desktop、kde-workspace、gnome-shell、unity这些),如果没有了,尝试安装他们,总之在不要“带病”重启,以防重启以后是个黑屏进不了图形界面
OK,现在可以重启了。升级过程完成。如果升级一切顺利,这可以运行
代码: 全选
sudo apt-get autoremove
sudo apt-get autoclean