Ubuntu 15.10 软件包系统损坏

Ubuntu 15.10 软件包系统损坏

我知道这个问题之前已经被问过很多次了,我查了一下。但我还没有找到解决问题的方法。如果我尝试更新软件中心,它会说我的软件包系统坏了。

跑步

sudo apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-image-4.2.0-18-generic
Suggested packages:
  fdutils linux-doc-4.2.0 linux-source-4.2.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.2.0-18-generic
0 upgraded, 1 newly installed, 0 to remove and 32 not upgraded.
1 not fully installed or removed.
Need to get 0 B/17,3 MB of archives.
After this operation, 50,2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: Perl may be unconfigured (Can't locate re.pm in @INC (you may need to install the re module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/share/perl/5.20/Text/Wrap.pm line 58.
BEGIN failed--compilation aborted at /usr/share/perl/5.20/Text/Wrap.pm line 58.
Compilation failed in require at /usr/share/perl5/Debconf/Template.pm line 10.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Template.pm line 10.
Compilation failed in require at /usr/share/perl5/Debconf/Question.pm line 8.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Question.pm line 8.
Compilation failed in require at /usr/share/perl5/Debconf/Config.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Config.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at (eval 1) line 4.
BEGIN failed--compilation aborted at (eval 1) line 4.
) -- aborting
(Reading database ... 218202 files and directories currently installed.)
Preparing to unpack .../linux-image-4.2.0-18-generic_4.2.0-18.22_amd64.deb ...
Can't locate re.pm in @INC (you may need to install the re module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/share/perl/5.20/Text/Wrap.pm line 58.
BEGIN failed--compilation aborted at /usr/share/perl/5.20/Text/Wrap.pm line 58.
Compilation failed in require at /usr/share/perl5/Debconf/Template.pm line 10.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Template.pm line 10.
Compilation failed in require at /usr/share/perl5/Debconf/Question.pm line 8.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Question.pm line 8.
Compilation failed in require at /usr/share/perl5/Debconf/Config.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Config.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm line 7.
Compilation failed in require at /usr/share/debconf/frontend line 6.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 6.
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.2.0-18-generic_4.2.0-18.22_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 2
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.2.0-18-generic /boot/vmlinuz-4.2.0-18-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.2.0-18-generic /boot/vmlinuz-4.2.0-18-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.2.0-18-generic_4.2.0-18.22_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

非常感谢您的帮助。谢谢。

答案1

缺少的库在perl-base。我希望您没有从系统中删除 Perl。

由于包装系统略有损坏,请使用替代方法:

wget http://mirrors.kernel.org/ubuntu/pool/main/p/perl/perl-base_5.20.2-6_amd64.deb
sudo dpkg -i --force-all perl-base_5.20.2-6_amd64.deb
sudo apt-get install -f

现在检查你的路径

perl -e "print qq(@INC)"

它应该包括

/usr/lib/x86_64-linux-gnu/perl/5.20.2/

相关内容