欢迎访问个人小站,阅读原文http://www.yandong.org/archives/379
对于ubuntu服务器版本的升级,没有图形化工具,需要人工干预许多事情。下面是我的升级方法和经验。从11.10升级到12.04.
(1) 更新下载软件包 apt-get update
(2) 安装最新的更新 apt-get upgrade
(3) 安装更新包的核心 apt-get install update-manager-core
(4) 打开文件/etc/update-manager/release-upgrades
vi /etc/update-manager/release-upgrades
看是否提示正常
(5) 然后运行 do-release-upgrade
(6) 开始升级
do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [198 B]
Get:2 Upgrade tool [1550 kB]
Fetched 1550 kB in 0s (0 B/s)
authenticate “precise.tar.gz” against “precise.tar.gz.gpg”
extracting “precise.tar.gz”
Reading cache
Checking package manager
Continue running under SSH?
This session appears to be running under ssh. It is not recommended to perform a upgrade over ssh currently because in case of failure it is harder to recover.
If you continue, an additional ssh daemon will be started at port
”1022″.
Do you want to continue?
Continue [yN]
Starting additional sshd
To make recovery in case of failure easier, an additional sshd will be started on port “1022″. If anything goes wrong with the running ssh you can still connect to the additional one.
To continue please press [ENTER]
[...]
Do you want to start the upgrade?
2 installed packages are no longer supported by Canonical. You can
still get support from the community.
5 packages are going to be removed. 52 new packages are going to be
installed. 426 packages are going to be upgraded.
You have to download a total of 286 M. This download will take about
2 minutes with your connection.
Installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled.
Continue [yN] Details [d]
在更新过程中,一些服务可能需要重新启动。如果更新管理问你哪些服务应该重新启动(它显示了一个服务列表),只接受按默认服务输入。
在升级过程结束时,应该删除过时的包:
Remove obsolete packages?
19 packages are going to be removed.
Continue [yN] Details [d]
服务器需要重新启动才能完成升级:
System upgrade is complete.
Restart required
To finish the upgrade, a restart is required.
If you select “y” the system will be restarted.
Continue [yN]
重新启动后,可以肯定的是您的服务器正在运行的Ubuntu 12.04。来/ etc / issue中看看:
cat /etc/issue
root@server1:~# cat /etc/issue
Ubuntu 12.04 LTS \n \l
或者使用 lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
遇到的问题:
(1)升级过程中我遇到了这样的错误
Calculating the changes
Calculating the changes
Error authenticating some packages
It was not possible to authenticate some packages. This may be a
transient network problem. You may want to try again later. See below
for a list of unauthenticated packages.
debootstrap
libjs-jquery
Restoring original system state
Aborting
意思就是 debootstrap,libjs-jquery 这两个包未验证,导致没法继续升级,我的做法是先把这两个包卸载,以完成升级,升级之后再把这两个包装上。