debconf 损坏,无法再更新、安装或修复任何软件包

debconf 损坏,无法再更新、安装或修复任何软件包

每次我尝试更新或安装新软件包时,都会收到以下错误:

┌──(mahdi㉿kali)-[~]
└─$ sudo apt update                     
Hit:1 http://packages.microsoft.com/repos/code stable InRelease                                                                                                                    
Hit:3 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic InRelease                                                                                                       
Hit:5 https://packages.sury.org/php buster InRelease                                                                                                                               
Hit:6 https://repo.protonvpn.com/debian stable InRelease                                                                                                                          
Hit:7 https://download.mono-project.com/repo/debian bionic InRelease                                                                                                           
Hit:8 http://ppa.launchpad.net/uget-team/ppa/ubuntu bionic InRelease                                                                                                           
Get:10 https://packages.microsoft.com/debian/11/prod bullseye InRelease [10.5 kB]                                                                        
Hit:2 http://mirror.karneval.cz/pub/linux/kali kali-last-snapshot InRelease                                                                      
Hit:4 http://wlglam.fsmg.org.nz/kali kali-rolling InRelease                                                           
Hit:9 http://ftp.halifax.rwth-aachen.de/kali kali-bleeding-edge InRelease          
Get:11 http://mirror-1.truenetwork.ru/kali kali-experimental InRelease [23.0 kB]
Fetched 33.4 kB in 4s (7,728 B/s)    
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://packages.microsoft.com/debian/11/prod bullseye InRelease' doesn't support architecture 'i386'
┌──(mahdi㉿kali)-[~]
└─$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
debconf: Perl may be unconfigured (syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178, near "sudo exec"
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 182, near "} and"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 190.
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 191.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 196, near "else"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 197.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 199.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 202.
Global symbol "$kidpid" requires explicit package name (did you forget to declare "my $kidpid"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 203.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 212, near "}"
/usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm has too many errors.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open2.pm line 31.
Compilation failed in require at /usr/share/perl5/Debconf/ConfModule.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/ConfModule.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
Compilation failed in require at (eval 1) line 8.
BEGIN failed--compilation aborted at (eval 1) line 8.
) -- aborting
Setting up debconf (1.5.79) ...
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178, near "sudo exec"
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 182, near "} and"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 190.
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 191.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 196, near "else"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 197.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 199.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 202.
Global symbol "$kidpid" requires explicit package name (did you forget to declare "my $kidpid"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 203.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 212, near "}"
/usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm has too many errors.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open2.pm line 31.
Compilation failed in require at /usr/share/perl5/Debconf/ConfModule.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/ConfModule.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
Compilation failed in require at /usr/share/debconf/frontend line 8.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 8.
dpkg: error processing package debconf (--configure):
 installed debconf package post-installation script subprocess returned error exit status 255
Errors were encountered while processing:
 debconf
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试重新安装 debconf 但是:

┌──(mahdi㉿kali)-[~]
└─$ sudo apt install --reinstall debconf                                                                                                                          
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for debconf:amd64

修复包也不起作用:

┌──(mahdi㉿kali)-[~]
└─$ sudo apt --fix-broken install                                                                                                                                             100 ⨯
Reading package lists... Done
Building dependency tree... Done
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, 0 B of additional disk space will be used.
debconf: Perl may be unconfigured (syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178, near "sudo exec"
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 182, near "} and"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 190.
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 191.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 196, near "else"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 197.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 199.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 202.
Global symbol "$kidpid" requires explicit package name (did you forget to declare "my $kidpid"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 203.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 212, near "}"
/usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm has too many errors.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open2.pm line 31.
Compilation failed in require at /usr/share/perl5/Debconf/ConfModule.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/ConfModule.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
Compilation failed in require at (eval 1) line 8.
BEGIN failed--compilation aborted at (eval 1) line 8.
) -- aborting
Setting up debconf (1.5.79) ...
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178, near "sudo exec"
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 182, near "} and"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 190.
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 191.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 196, near "else"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 197.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 199.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 202.
Global symbol "$kidpid" requires explicit package name (did you forget to declare "my $kidpid"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 203.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 212, near "}"
/usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm has too many errors.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open2.pm line 31.
Compilation failed in require at /usr/share/perl5/Debconf/ConfModule.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/ConfModule.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
Compilation failed in require at /usr/share/debconf/frontend line 8.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 8.
dpkg: error processing package debconf (--configure):
 installed debconf package post-installation script subprocess returned error exit status 255
Errors were encountered while processing:
 debconf
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

我什至尝试手动安装 debconf:

┌──(mahdi㉿kali)-[~]
└─$ sudo dpkg -i '/home/mahdi/Downloads/Applications/debconf_1.5.73_all.deb'                                                                                                  100 ⨯
dpkg: warning: downgrading debconf from 1.5.79 to 1.5.73
(Reading database ... 543793 files and directories currently installed.)
Preparing to unpack .../debconf_1.5.73_all.deb ...
Unpacking debconf (1.5.73) over (1.5.79) ...
Setting up debconf (1.5.73) ...
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178, near "sudo exec"
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 182, near "} and"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 190.
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 191.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 196, near "else"
Global symbol "$stat_w" requires explicit package name (did you forget to declare "my $stat_w"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 197.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 199.
Global symbol "$stat_r" requires explicit package name (did you forget to declare "my $stat_r"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 202.
Global symbol "$kidpid" requires explicit package name (did you forget to declare "my $kidpid"?) at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 203.
syntax error at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 212, near "}"
/usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm has too many errors.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open2.pm line 31.
Compilation failed in require at /usr/share/perl5/Debconf/ConfModule.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/ConfModule.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/AutoSelect.pm line 8.
Compilation failed in require at /usr/share/debconf/frontend line 8.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 8.
dpkg: error processing package debconf (--install):
 installed debconf package post-installation script subprocess returned error exit status 255
Processing triggers for kali-menu (2021.4.2) ...
Errors were encountered while processing:
 debconf

即使 dist-update 也不起作用:

┌──(mahdi㉿kali)-[~]
└─$ sudo apt dist-upgrade                                                                                                                                                       1 ⨯
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 debconf-i18n : Depends: debconf (= 1.5.79) but 1.5.73 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

嘿嘿嘿:(

答案1

/usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm已损坏,您需要重新安装perl-base

sudo apt reinstall perl-base

相关内容