我在尝试解决 apt 依赖关系时出现以下输出错误。
root@eve-ng:/usr/lib/perl5# apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libc6 linux-headers-4.4.0-150-generic linux-headers-generic
Suggested packages:
glibc-doc
The following NEW packages will be installed:
linux-headers-4.4.0-150-generic
The following packages will be upgraded:
libc6 linux-headers-generic
2 upgraded, 1 newly installed, 0 to remove and 178 not upgraded.
29 not fully installed or removed.
Need to get 0 B/3,385 kB of archives.
After this operation, 7,605 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Bareword found where operator expected at /usr/share/perl/5.22/fields.pm line 3, near "0ubuntu1"
(Missing operator before ubuntu1?)
Semicolon seems to be missing at /usr/share/perl/5.22/fields.pm line 3.
Unquoted string "universe" may clash with future reserved word at /usr/share/perl/5.22/fields.pm line 5.
debconf: Perl may be unconfigured (syntax error at /usr/share/perl/5.22/fields.pm line 2, near "accountwizard
Architecture:"
Unknown regexp modifier "/b" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Regexp modifier "/u" may not appear twice at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/t" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Regexp modifier "/u" may not appear twice at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/v" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/e" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/r" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/e" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/k" at /usr/share/perl/5.22/fields.pm line 9, at end of line
/usr/share/perl/5.22/fields.pm has too many errors.
Compilation failed in require at /usr/share/perl5/Debconf/DbDriver.pm line 13.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/DbDriver.pm line 13.
Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 9.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm line 9.
Compilation failed in require at /usr/share/perl5/Debconf/Question.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Question.pm line 7.
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 ... 220043 files and directories currently installed.)
Preparing to unpack .../libc6_2.23-0ubuntu11_amd64.deb ...
Bareword found where operator expected at /usr/share/perl/5.22/fields.pm line 3, near "0ubuntu1"
(Missing operator before ubuntu1?)
Semicolon seems to be missing at /usr/share/perl/5.22/fields.pm line 3.
Unquoted string "universe" may clash with future reserved word at /usr/share/perl/5.22/fields.pm line 5.
syntax error at /usr/share/perl/5.22/fields.pm line 2, near "accountwizard
Architecture:"
Unknown regexp modifier "/b" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Regexp modifier "/u" may not appear twice at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/t" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Regexp modifier "/u" may not appear twice at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/v" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/e" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/r" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/e" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/k" at /usr/share/perl/5.22/fields.pm line 9, at end of line
/usr/share/perl/5.22/fields.pm has too many errors.
Compilation failed in require at /usr/share/perl5/Debconf/Template.pm line 15.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Template.pm line 15.
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/libc6_2.23-0ubuntu11_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 255
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.23-0ubuntu11_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我不知道还能做什么我还申请了:
root@eve-ng:/usr/lib/perl5# dpkg -i /var/cache/apt/archives/libc6_2.23-0ubuntu11_amd64.deb
(Reading database ... 220043 files and directories currently installed.)
Preparing to unpack .../libc6_2.23-0ubuntu11_amd64.deb ...
Bareword found where operator expected at /usr/share/perl/5.22/fields.pm line 3, near "0ubuntu1"
(Missing operator before ubuntu1?)
Semicolon seems to be missing at /usr/share/perl/5.22/fields.pm line 3.
Unquoted string "universe" may clash with future reserved word at /usr/share/perl/5.22/fields.pm line 5.
syntax error at /usr/share/perl/5.22/fields.pm line 2, near "accountwizard
Architecture:"
Unknown regexp modifier "/b" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Regexp modifier "/u" may not appear twice at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/t" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Regexp modifier "/u" may not appear twice at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/v" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/e" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/r" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/e" at /usr/share/perl/5.22/fields.pm line 9, at end of line
Unknown regexp modifier "/k" at /usr/share/perl/5.22/fields.pm line 9, at end of line
/usr/share/perl/5.22/fields.pm has too many errors.
Compilation failed in require at /usr/share/perl5/Debconf/Template.pm line 15.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Template.pm line 15.
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/libc6_2.23-0ubuntu11_amd64.deb (--install):
subprocess new pre-installation script returned error exit status 255
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.23-0ubuntu11_amd64.deb
但没有任何好结果。关于如何解决这个问题有什么建议吗?对我来说这似乎是 Perl 问题。问候。
答案1
该/usr/share/perl/5.22/fields.pm
文件(软件包的一部分perl-modules-5.22
)已损坏。它似乎已被软件包管理文件替换。
这很麻烦,表明文件系统已发生某种程度的损坏。系统上的其他重要文件可能也已损坏;如果可能,您应该备份所有数据并重新安装系统。
尽管如此,如果你想尝试恢复这个系统,你的第一步备份数据后应该重新安装perl-modules-5.22
。
答案2
我能够应用 apt -f install 并通过首先安装以下软件包来修复依赖项。
dpkg -i perl-modules-5.22_5.22.1-9ubuntu0.6_all.deb
dpkg -i linux-headers-4.4.0-150_4.4.0-150.176_all.deb
dpkg -i libperl5.22_5.22.1-9ubuntu0.6_amd64.deb
dpkg -i libssl1.0.0_1.0.2g-1ubuntu4.15_amd64.deb
dpkg -i linux-headers-4.4.0-150-generic_4.4.0-150.176_amd64.deb
dpkg -i libc6_2.23-0ubuntu11_amd64.deb
然后再次运行该命令并且成功了!!
root@eve-ng:~# apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-headers-generic
The following packages will be upgraded:
linux-headers-generic
1 upgraded, 0 newly installed, 0 to remove and 177 not upgraded.
27 not fully installed or removed.
Need to get 0 B/2,576 B of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 229876 files and directories currently installed.)
Preparing to unpack .../linux-headers-generic_4.4.0.150.158_amd64.deb ...
Unpacking linux-headers-generic (4.4.0.150.158) over (4.4.0.141.147) ...
Setting up grub-pc (2.02~beta2-36ubuntu3.19) ...
Installing for i386-pc platform.
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.14-eve-ng-ukms+
Found initrd image: /boot/initrd.img-4.4.14-eve-ng-ukms+
Found linux image: /boot/vmlinuz-4.4.0-150-generic
done
Setting up tzdata (2018i-0ubuntu0.16.04) ...
Current default time zone: 'Europe/Riga'
Local time is now: Sat Jun 15 01:56:23 EEST 2019.
Universal Time is now: Fri Jun 14 22:56:23 UTC 2019.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
Setting up libsasl2-modules:amd64 (2.1.26.dfsg1-14ubuntu0.1) ...
Setting up libc6-dev:amd64 (2.23-0ubuntu11) ...
Setting up libc6-i386 (2.23-0ubuntu11) ...
Setting up libwinpr-utils0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libwinpr-pool0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-codec1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-common1.1.0:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-utils1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-crypto1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-locale1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libwinpr-rpc0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libwinpr-sspi0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-core1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-cache1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-client1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-gdi1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up libfreerdp-plugins-standard:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ...
Setting up linux-headers-4.4.0-141-generic (4.4.0-141.167) ...
Examining /etc/kernel/header_postinst.d.
Setting up linux-headers-generic (4.4.0.150.158) ...
Setting up linux-headers-virtual (4.4.0.150.158) ...
Setting up linux-modules-4.4.0-150-generic (4.4.0-150.176) ...
Setting up linux-image-4.4.0-150-generic (4.4.0-150.176) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.4.14-eve-ng-ukms+
I: /initrd.img.old is now a symlink to boot/initrd.img-4.4.14-eve-ng-ukms+
I: /vmlinuz is now a symlink to boot/vmlinuz-4.4.0-150-generic
I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-150-generic
Setting up linux-image-virtual (4.4.0.150.158) ...
Setting up linux-virtual (4.4.0.150.158) ...
Setting up openssl (1.0.2g-1ubuntu4.14) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for linux-image-4.4.0-150-generic (4.4.0-150.176) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-150-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.14-eve-ng-ukms+
Found initrd image: /boot/initrd.img-4.4.14-eve-ng-ukms+
Found linux image: /boot/vmlinuz-4.4.0-150-generic
Found initrd image: /boot/initrd.img-4.4.0-150-generic
done
之后我继续申请
apt update && apt upgrade
没有错误。