无法删除 aspell-en 以尝试修复失败的 dist-upgrade?

无法删除 aspell-en 以尝试修复失败的 dist-upgrade?

有一次,我尝试对远程 Ubuntu 12.04(我认为是 14.04)系统进行分布式升级,但升级失败了。

现在,我已经可以物理访问该机器了,我正在尝试修复它。首先,我设法eth0通过添加 eth0 行/etc/network/interfaces然后重新启动(进入恢复控制台/终端)来启动网络接口;然后我尝试这样做:

# apt -f install
...
22 upgraded, 464 newly installed, 183 to remove and 52 not upgraded.
5 not fully installed or removed.
Need to get 0 B/257MB of archives.
After this operation, 777 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: delaying package configuration, since apt-utils is not installed.
(Reading database ... 176434 files and directories currently installed.)
Removing aspell-en (7.1-0-1) ...
Can't locate Text/Iconv.pm in @INC (you may need to install the Text::Iconv module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at /usr/share/perl5/Debian/DictionariesCommon.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debian/DictionariesCommon.pm line 7.
Compilation failed in require at /usr/sbin/update-dictcommon-aspell line 4.
BEGIN failed--compilation aborted at /usr/sbin/update-dictcommon/aspell line 4.
dpkg: error processing package aspell-en (--remove):
  subprocess installed post-removal script returned error exit status 2
Removing python-software-properties (0.92.37.8) ...
Errors were encountered while processing:
 aspell-en
E: Sub-process /usr/bin/dpkg returned an error code (1)
#

所以,我的问题是:

  • 我该如何恢复?显然,在依赖关系修复之前,我无法使用 apt 安装或删除单个软件包,因此我无法单独处理 aspell-en - 显然,install Text::Iconvviacpan也会失败

  • 为什么此安装过程需要定位任何事物 根本消除?我不是在安装,我是在删除——我根本不在乎软件的组件是否被找到,如果我移除一个软件?!

答案1

让我们通过下载包并直接安装来从低层次上解决这个问题:

apt-get download libtext-iconv-perl
sudo dpkg -i --force-all libtext-iconv-perl*.deb

然后继续使用

sudo apt-get install -f
sudo apt-get install --reinstall libtext-iconv-perl
sudo apt-get dist-upgrade # to get newest dependencies

答案2

好的,感谢@N0rbert,这个问题现在已经解决了。当我重新运行cpan,然后install Text::Iconv,我意识到正在构建一个 32 位模块;这失败了wrong ELF class: ELFCLASS32

显然,由于这是一个损坏的更新,您无法对单个包执行apt/apt-get install任何操作apt/apt-get remove,直到 的依赖关系apt得到修复(并且 的依赖关系修复apt失败,如 OP 中所示)。

诀窍是仅下载的 .deb 包libtext-iconv-perl,然后通过以下方式安装dpkg

apt-get download libtext-iconv-perl
dpkg -i ./libtext-iconv-perl_1.7-5build2_amd64.deb

因此,幸运的是,我在这里得到了 64 位二进制文​​件libtext-iconv-perl- 而且现在,幸运的是,apt -f install我设法删除了aspell-en- 并且修复过程仍在继续......

相关内容