魅力博客

魅力Linux|魅力空间|魅力博客|学习Linux|ubuntu日记|电脑教程|手机软件

在ubuntu11.10到ubuntu12.04中进行跨版本升级的正确方法



一个系统用久了,有了感情了。而且对于ubuntu来说,每半年升级一次版本大家都是习以为常的啦,但是如何正确并减少升级过程中出错的概率,相信一直是大家所关注与探讨的话题。呵呵,在这里,我总觉一下前辈们的经验并做了一些整理。希望对大家有所帮助。

对于升级过程中的出错问题我们不能预见,我个人觉得最稳妥的方法是:先备份目前的系统,然后再进行对系统的升级。(对于备份系统,请详见我的另一个博文:Ubuntu系统备份恢复)

在备份好系统之后,做了无后顾之忧之后,呵呵,那就进入我们今天所要说的正题了:

升级前,请卸载和删除不太必要的软件包,使系统变得相对简单干净,再升级,以减少升级耗时,和减少出错的几率。删除的包可以升级后再重新安装上。
本方案使用update-manager来跨版本升级,请确保已经安装update-manager再执行下面的步骤。

代码:
sudo gedit  /etc/apt/sources.list


修改源,论坛里面有一个“新立得和软件原”的版块,关于源添加哪些源的问题请到里面查询。
用#注释掉12.04的源,从论坛里面复制一个12.10的源进去。(我用的是下面的,这个叫“主源”)

引用:
#deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ quantal-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ quantal-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ quantal-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ quantal-backports main restricted universe multiverse


以下源也可供选择(替换上面的“http://archive.ubuntu.com/ubuntu/”这一部分):
http://mirrors.163.com/ubuntu/ #163源
http://mirrors.ustc.edu.cn/ubuntu/ #教育源
http://cn.archive.ubuntu.com/ubuntu/ #中国的服务器[/quote]

代码:
 sudo apt-get update

更新源列表,必须执行.如果发现速度慢则换别的源。

代码:
sudo apt-get -d dist-upgrade

"-d" 表示只下载文件 ,先把文件下载下来,防止因网络慢或不稳定造成问题。如果速度慢则换源再继续。(如果这一步都报错,就不要继续了!切记)

代码:
sudo update-manager -d

跨版本升级,按照跳出的提示,选择“部分更新”

升级完成之后,系统会要求你重启。不急,选择不重启。为了系统下次能够正常启动,还需要进行进一步软件包检查。关闭升级窗口之后,再重复使用:

代码:
sudo apt-get update
sudo apt-get upgrade



如果有软件包可以升级。将它们全部升级完毕。直到没的升为止。
但是由于12.10处于试用状态,以上两句可能会出现错误。

在这里,如果升级过程中出现过“依赖关系损坏的包”,尽量先修复,或者删除,然后检查图形界面的包还在不在(ubuntu-desktop、kubuntu-desktop、kde-workspace、gnome-shell、unity这些),如果没有了,尝试安装他们,总之在不要“带病”重启,以防重启以后是个黑屏进不了图形界面

OK,现在可以重启了。升级过程完成。如果升级一切顺利,这可以运行

代码:
sudo apt-get autoremove
sudo apt-get autoclean

来清除旧有的文件,节约硬盘空间。

对以上方法,已经有前辈在11.10到12.04中测试过了,对于即将发布的ubuntu12.10就还没有测试,但是我觉得只要细心,谨慎。方法都差不都。但是在这里我还是要提醒大家慎重。同时,ubuntu12.10即将正式发布。也建议大家推迟升级新版本,待新版本发布之后一个月以后在在升级,到那时候,大体上的系统是比较稳定的啦,就算有些小漏洞,也会给一些跑在前面的高人们解决掉啦。呵呵。最后祝大家升级成功。



返回顶部

发表评论:

Powered By Z-BlogPHP 1.7.3


知识共享许可协议
本作品采用知识共享署名 3.0 中国大陆许可协议进行许可。
网站备案号粤ICP备15104741号-1