ubuntu的apt-get upgrade命令停在read changlog不工作的处理办法

无论是aptget还是aptitude都upgrade不成功。

显示为读取changelog的时候,ssh返回一个tmp目录下的记录changelog的文件,命令行不滚动了。然后,等好长时间之后,只好control+c,终止进程(但是似乎终止不干净),重新输入upgrade命令,发现之前一个更新也没有装。看var下边apt的log文件也证明没有安装成功。

后来发现提示var/mail下边有信,打开看了发现如下内容:

E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable) E: Unable to lock directory /var/cache/apt/archives/

所以怀疑进程没有正常终止,如下命令清楚锁:

sudo killall apt-get
sudo rm -rf /var/cache/apt/archives/lock
sudo apt-get update

, 重试,问题依旧。后来搜索“Reading changelogs”发现这篇文章中提到apt-listchanges

“Reading changelogs.” apt-listchanges isn’t particularly useful, and I don’t know why I installed it. But it’s really painful when it’s taking more time to read changelogs than to install your software. Geoffrey suggested gdb -p `pgrep apt-listchanges` and then forcing it to call exit(0), which worked like a charm. Had to do this several times; thought it was infinitely looping.

记得之前在其他的文章中也看过这个程序,所以怀疑是他的原因。

sudo apt-get purge apt-listchanges

删除这个软件之后,apt-get upgrade恢复正常。

参考:

Ubuntu 11.04 update manager got stuck Fix for – E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable) 解决了Could not get lock /var/cache/apt/archives/lock

另外,ubuntu的apt-get参考: AptGetHowto

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>