![apt-get upgrade 时出错](https://linux22.com/image/821354/apt-get%20upgrade%20%E6%97%B6%E5%87%BA%E9%94%99.png)
我最近将服务器从 8.04 更新到 10.04,更新基本顺利进行,但现在每次我使用 apt-get 时都会收到奇怪的错误消息。
:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up gcj-4.4-jre-headless (4.4.3-1ubuntu4.1) ...
update-alternatives: error: /var/lib/dpkg/alternatives/rmid corrupt: invalid status
dpkg: error processing gcj-4.4-jre-headless (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
gcj-4.4-jre-headless
E: Sub-process /usr/bin/dpkg returned an error code (1)
我甚至没有在那台机器上使用 java。我该如何摆脱它(apt-get remove 或 purge 不起作用)。
有什么想法吗?感谢您的帮助。
答案1
好吧,我找不到解决方案,所以我只是从文件夹 /var/lib/dpkg/info/ 中删除了所有以 gcj-4.4-jre-headless 开头的文件。我不知道这是否是最好的主意,但它确实有效。祝所有读到这篇文章的人好运。