apt-get check` 실패 문제를 해결하는 방법, 패키지가 깨졌을 수 있습니다.

apt-get check` 실패 문제를 해결하는 방법, 패키지가 깨졌을 수 있습니다.

Ubuntu 18.04.1 LTS(GNU/Linux 4.9.0-15-amd64 x86_64) 및 Swizzin Box를 실행하는 임대 전용 서버에서 box autodl 패키지를 제거하고 다시 설치하여 손상된 autodl irssi 설치를 수정해 보았습니다.

autodl을 제거하면 다음과 같습니다.

SUCCESS autodl removed 
ERROR dpkg database is locked by apt-get. Please try again later

다시 설치하려고하면 :-

INFO Installing autodl 
E: Unable to correct problems, you have held broken packages. 
ERROR The simulation check resulted in an error. Please consult the log.

로그가 표시됩니다

Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 pkg-config : Depends: libdpkg-perl but it is not installed

'apt --fix-broken install'을 실행하면 다음이 제공됩니다.

0 upgraded, 0 newly installed, 1 to remove and 107 not upgraded.
After this operation, 193 kB disk space will be freed.
Do you want to continue? [Y/n] y

(Reading database ... 87206 files and directories currently installed.)

Removing pkg-config (0.29-4+b1) ...

Can't locate Dpkg/Arch.pm in @INC (you may need to install the Dpkg::Arch module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/pkg-config-dpkghook line 14.

BEGIN failed--compilation aborted at /usr/share/pkg-config-dpkghook line 14.

dpkg: error processing package pkg-config (--remove):

 subprocess installed pre-removal script returned error exit status 2

Errors were encountered while processing:

 pkg-config

E: Sub-process /usr/bin/dpkg returned an error code (1)

이 문제를 해결할 수 있는 방법을 제안하는 사람이 있습니까?

답변1

노력하다 sudo apt --fix-broken install libdpkg-pearl. 또한 고정된 패키지가 있는지 확인하고 apt policy, 실행하여 흥미로운 것이 있는지 확인하세요. 이 경우 'interesting'에는 모든 타사 저장소가 포함됩니다. 행에 "ubuntu.com"이 포함되어 있지 않으면 의심스러운 것입니다.

재배포할 수 없는 독점 소프트웨어나 최신 업스트림 버전의 소프트웨어가 꼭 필요한 경우와 같이 타사 리포지토리(Canonical이 아닌 리포지토리)가 필요한 경우가 있습니다. 그러나 이러한 리포지토리는 사용 중인 모든 OS의 기본 설치와 함께 작동하도록 특별히 설계되어야 하며 관련 없는 패키지를 포함해서는 안 됩니다. 다른 운영 체제에 대한 참조를 추가하여 호환성을 얻으려고 시도해서는 절대 안 됩니다. 예를 들어 Debian Stretch를 Ubuntu Bionic 릴리스의 패키지 소스로 추가하는 식입니다. 이상한 패키지 충돌과 예상치 못한 교체가 많이 발생할 수 있습니다.

나는 chroot에서 이 상황을 재현할 수 없었습니다. apt --fix-broken install일부 공격적인 제거 후에도 작동했습니다. Aptitude는 더 많은 정보를 제공할 수 있지만 현재 패키지가 엉망이라는 점을 고려하면 이를 실행할 수 있을지 의문입니다. 페이스트빈(pastebin)은 dpkg --list디버깅 정보의 다음 비트가 될 것입니다.

관련 정보