0

I tried fixing a broken autodl irssi installation on a rented dedicated server running Ubuntu 18.04.1 LTS (GNU/Linux 4.9.0-15-amd64 x86_64) and Swizzin Box by removing and reinstalling the box autodl package.

removing autodl gave :-

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

trying to reinstall it gave :-

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.

the log shows

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

running 'apt --fix-broken install' gives :-

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)

Does anyone have any suggestions how I can resolve this issue?

3
  • Looks as if it's looking for some Perl libraries. Google Perl install and see how to install this package. Dpkg::Arch module Jun 13, 2021 at 19:37
  • Trying to install perl gives
    – Paladinz
    Jun 13, 2021 at 19:52
  • trying to install perl gives perl : Depends: perl-modules-5.26 (>= 5.26.1-6ubuntu0.5) but it is not going to be installed Depends: libperl5.26 (= 5.26.1-6ubuntu0.5) but it is not going to be installed pkg-config : Depends: libdpkg-perl but it is not going to be installed Trying to install these gives The following packages have unmet dependencies: pkg-config : Depends: libdpkg-perl but it is not going to be installed
    – Paladinz
    Jun 13, 2021 at 20:17

1 Answer 1

0

Try sudo apt --fix-broken install libdpkg-pearl. Also, look to see if you have any pinned packages: run apt policy, and check for anything interesting. In this case, 'interesting' includes any third-party repositories: if the line doesn't include "ubuntu.com", its suspicious.

There are cases where third-party repositories (those that aren't from Canonical) are needed, such as for proprietary software that can't be redistributed or when the latest upstream version of software is a hard requirement. However, these repositories MUST be designed specifically to work with the base installation of whatever OS you have, and should not contain extraneous packages. You should absolutely never attempt to gain compatibility by adding references to another operating system: for instance, by adding Debian Stretch as a package source for a Ubuntu Bionic release. Lots of bizarre package conflicts and unexpected replacements can occur.

I wasn't able to recreate this situation in a chroot: apt --fix-broken install worked even after some aggressive removals. Aptitude may be able to give you more info, but I doubt you'll be able to get it running, given you're current package mess. A pastebin of dpkg --list would be the next bit of debugging information.

19
  • thanks Calum, sudo apt --fix-broken install libdpkg-pearl returns E: Unable to locate package libdpkg-pearl. I don't know enough to spot what would be interesting in apt policy but the output is here if you have the time to look at it. the output from dpkg --list is here
    – Paladinz
    Jun 14, 2021 at 16:47
  • 1
    after rereading your comment I spotted the autocorrect and ran the command with perl not pearl. it returns You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: libdpkg-perl : Depends: perl but it is not going to be installed Recommends: libfile-fcntllock-perl but it is not going to be installed Recommends: liblocale-gettext-perl but it is not going to be installed
    – Paladinz
    Jun 14, 2021 at 18:06
  • @Paladinz Sorry for the late response. The reason I was interested in apt-policy is because pinned packages and other weird things can interfere with APT's normal functioning. It seems this is partially the case here: you are not running Ubuntu BONIC, but instead a blend of Debian Stretch, Buster-Backports, and Bonic. This is a massive problem: these repositories are not intended to be used simultaneously. Because the versions progress differently, you get some new Ubuntu packages, some old Debian packages, and some super new Debian packages. You're going to want to fix that. Jun 17, 2021 at 18:41
  • @Paladinz the solution is going to be a bit involved. Go through the sources.list and sources.list.d files, and remove anything that includes the 'debian.org' domain, as well as the leaseweb mirrors of the debian files. It looks like the only two third-party repositories you need are syncthing and nodesource. If you truly need the upstream version of that software, take another look at their installation docs. However, Node.JS as well as SyncThing are available in the official Ubuntu repositories, so you can probably remove those lines as well. After this, try troubleshooting again. Jun 17, 2021 at 18:49
  • thank you, we all have lives so any useful response is welcome even if it takes some time :) I'll clean up the sources and see what happens.
    – Paladinz
    Jun 18, 2021 at 9:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .