3

In ubuntu 20.04 (upgraded from 18.04) I'm trying to install libcairo2-dev but I am getting info about missing dependencies. Finally it liitks like everything is installed but there is some problem with lib naming or something. Anyone has any ideas?

> sudo apt install libcairo2-dev

The following packages have unmet dependencies:
 libcairo2-dev : Depends: libglib2.0-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

then

> sudo apt install libglib2.0-dev

The following packages have unmet dependencies:
 libglib2.0-dev : Depends: libselinux1-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

then

> sudo apt install libselinux1-dev

The following packages have unmet dependencies:
 libselinux1-dev : Depends: libpcre2-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

then

> sudo apt install libpcre2-dev

The following packages have unmet dependencies:
 libpcre2-dev : Depends: libpcre2-8-0 (= 10.34-7) but 10.34-7+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.

but finally it is ok but not ok

> sudo apt install libpcre2-8-0

libpcre2-8-0 is already the newest version (10.34-7+ubuntu18.04.1+deb.sury.org+1).

EDIT:

@N0rbert: running:

> apt-cache policy libpcre2-8-0 libpcre2-dev libselinux1-dev libglib2.0-dev

outputs:

libpcre2-8-0:
  Installed: 10.34-7+ubuntu18.04.1+deb.sury.org+1
  Candidate: 10.34-7+ubuntu18.04.1+deb.sury.org+1
  Version table:
 *** 10.34-7+ubuntu18.04.1+deb.sury.org+1 100
        100 /var/lib/dpkg/status
     10.34-7 500
        500 http://mirror.switch.ch/ftp/mirror/ubuntu focal/main amd64 Packages
libpcre2-dev:
  Installed: 10.21-1
  Candidate: 10.34-7
  Version table:
     10.34-7 500
        500 http://mirror.switch.ch/ftp/mirror/ubuntu focal/main amd64 Packages
 *** 10.21-1 100
        100 /var/lib/dpkg/status
libselinux1-dev:
  Installed: (none)
  Candidate: 3.0-1build2
  Version table:
     3.0-1build2 500
        500 http://mirror.switch.ch/ftp/mirror/ubuntu focal/main amd64 Packages
libglib2.0-dev:
  Installed: (none)
  Candidate: 2.64.2-1~fakesync1
  Version table:
     2.64.2-1~fakesync1 500
        500 http://mirror.switch.ch/ftp/mirror/ubuntu focal/main amd64 Packages

@Parsa Mousavi: Installing from package doesn't works either:

> sudo dpkg -i libpcre2-dev_10.21-1_amd64.deb 

(Reading database ... 271075 files and directories currently installed.)
Preparing to unpack libpcre2-dev_10.21-1_amd64.deb ...
Unpacking libpcre2-dev:amd64 (10.21-1) over (10.21-1) ...
dpkg: dependency problems prevent configuration of libpcre2-dev:amd64:
 libpcre2-dev:amd64 depends on libpcre2-8-0 (= 10.21-1); however:
  Version of libpcre2-8-0:amd64 on system is 10.34-7+ubuntu18.04.1+deb.sury.org+1.
 libpcre2-dev:amd64 depends on libpcre2-16-0 (= 10.21-1); however:
  Version of libpcre2-16-0:amd64 on system is 10.34-7.
 libpcre2-dev:amd64 depends on libpcre2-32-0 (= 10.21-1); however:
  Version of libpcre2-32-0:amd64 on system is 10.34-7.
 libpcre2-dev:amd64 depends on libpcre2-posix0 (= 10.21-1); however:
  Package libpcre2-posix0 is not installed.

dpkg: error processing package libpcre2-dev:amd64 (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 libpcre2-dev:amd64
  • 3
    Does this answer your question? [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages) – karel Jun 08 '20 at 08:14
  • 2
    Are you really using deb.sury.org PPA? Please add output of `apt-cache policy libpcre2-8-0 libpcre2-dev libselinux1-dev libglib2.0-dev` to the question. – N0rbert Jun 08 '20 at 08:36
  • 1
    Download the problematic package "libpcre2-dev" from [here](https://packages.ubuntu.com/xenial/amd64/libpcre2-dev/download) and install it manually with " dpkg -i file_name.deb " – Parsa Mousavi Jun 08 '20 at 09:00
  • 1
    It seems you have installed libpcre from some unofficial sources or 3rd party PPA. Run `sudo apt install libpcre2-8-0=10.34-7` to install v10.34-7 which is [shipped](https://packages.ubuntu.com/focal/libpcre2-8-0) in focal. – Kulfy Jun 08 '20 at 09:45
  • @Kulfy: your suggestion worked. Please add it as answer. – Krzysiek Grzembski Jun 08 '20 at 10:57

1 Answers1

9

Focal Fossa's official repository contains liblibpcre2-8-0 v10.34-7. However, you have v10.34-7+ubuntu18.04.1+deb.sury.org+1 installed which clearly seems to be from third party source. Since the output of apt-cache policy libpcre2-8-0 shows that you don't have any sources which provides the unofficial version, you can install v10.34-7 using apt. To install run,

sudo apt install libpcre2-8-0=10.34-7
Kulfy
  • 17,416
  • 26
  • 64
  • 103