简洁的想法

仁爱、喜乐、和平、忍耐、恩慈、良善、信实、温柔、节制

Ubuntu 8.04 升级到 10.04

| Comments

命令如下
aptitude install update-manager-core
do-release-upgrade


开始有段警告, 大胆按 j 吧


Diese Sitzung läuft offenbar über SSH. Es wird davon abgeraten,
eine Systemaktualisierung über SSH durchzuführen, da im Fehlerfall
eine Wiederherstellung schwierig sein kann.

Wenn Sie fortfahren, wird ein zusätzlicher SSH-Dienst auf Port
»9004« gestartet.
Sind Sie sicher, dass Sie fortfahren möchten?


有段时间比较难熬, 估计有半小时之久
Es wird nach veralteter Software gesucht
Reading package lists: Done
Reading state information: Done
Reading state information: Done
Reading state information: Done
: 42




aptitude update
aptitude upgrade
aptitude dist-upgrade


升级另一台服务器的时候, 可能是先升级了内核, 因为没有重启, 在装软件的时候, 老是提示:
E: dpkg was interrupted, you must manually run 'dpkg -configure -a' to correct the problem.

如果真的执行那句命令, 却发现屏幕老是走几步就冻住不动了, 只好 Ctrl + C, 于是出现下面的画面:
Setting up at (3.1.11-1ubuntu5.1) …
dpkg: error processing at (-configure):
subprocess installed post-installation script killed by signal (Interrupt)
Setting up openssh-server (1:5.3p1-3ubuntu6) …
* Stopping OpenBSD Secure Shell server sshd
…done.
dpkg: error processing openssh-server (—configure):
subprocess installed post-installation script killed by signal (Interrupt)
Setting up mysql-server-5.1 (5.1.41-3ubuntu12.10) …
dpkg: error processing mysql-server-5.1 (—configure):
subprocess installed post-installation script killed by signal (Interrupt)
Setting up irqbalance (0.55+20091017-3ubuntu2) …
dpkg: error processing irqbalance (—configure):
subprocess installed post-installation script killed by signal (Interrupt)
Setting up rsyslog (4.2.0-2ubuntu8.1) …
dpkg: error processing rsyslog (—configure):
subprocess installed post-installation script killed by signal (Interrupt)
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.1; however:
Package mysql-server-5.1 is not configured yet.
dpkg: error processing mysql-server (—configure):
dependency problems – leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-minimal:
ubuntu-minimal depends on rsyslog; however:
Package rsyslog is not configured yet.
dpkg: error processing ubuntu-minimal (—configure):
dependency problems – leaving unconfigured
Errors were encountered while processing:
at
openssh-server
mysql-server-5.1
irqbalance
rsyslog
mysql-server
ubuntu-minimal

(Interrupt) 就是我按Ctrl + C 之后出现的.
google了半天也没有什么结果, 只好仔细分析出错信息, 最后我找到的解决的办法如下, 首先杀掉这些配置进程
ps -aux | grep 关键字
kill 掉那些配置进程

然后在这个目录下找到post-installation脚本:
cd /var/lib/dpkg/info/
ls openssh*
vi openssh-server.postinst


然后在第一行加入 exit 0 保存退出.
重新安装一个已经装好了的程序, 比如
apt-get install gcc
这个程序过后就会重复上面那堆出错信息, 不过会少了openssh-server,
依次解决其它的软件就好了.

在处理openssh-server的时候要小心, 尤其是SSH远程登录升级的朋友,  最好打开三两个窗口, 都登录到服务器, 在主窗口SSH服务关掉之后:
Setting up openssh-server (1:5.3p1-3ubuntu6) …
* Stopping OpenBSD Secure Shell server sshd
…done.

要在另外的窗口重新启动SSH,
/etc/init.d/ssh start

Comments