7

I'm trying

apt install libpcre3-dev

I get

eading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpcre3-dev : Depends: libpcre3 (= 2:8.39-12build1) but 
 2:8.43-1+ubuntu19.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.

When I try to install libpcre3:

apt install libpcre3

I get

Reading package lists... Done
Building dependency tree
Reading state information... Done
libpcre3 is already the newest version (2:8.43-1+ubuntu19.10.1+deb.sury.org+1).

How can I solve this issue? Note, I need to install libpcre3-dev because I want to build Nginx from source, where I get:

./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre= option.

As per request here is the output of apt-cache policy libpcre3 libpcre3-dev

libpcre3:
  Installed: 2:8.43-1+ubuntu19.10.1+deb.sury.org+1
  Candidate: 2:8.43-1+ubuntu19.10.1+deb.sury.org+1
  Version table:
 *** 2:8.43-1+ubuntu19.10.1+deb.sury.org+1 100
        100 /var/lib/dpkg/status
     2:8.39-12build1 500
        500 http://de.archive.ubuntu.com/ubuntu focal/main amd64 Packages
libpcre3-dev:
  Installed: (none)
  Candidate: 2:8.39-12build1
  Version table:
     2:8.39-12build1 500
        500 http://de.archive.ubuntu.com/ubuntu focal/main amd64 Packages
2
  • 1
    Please add output of apt-cache policy libpcre3 libpcre3-dev to the question.
    – N0rbert
    May 5, 2020 at 16:30
  • @N0rbert Done.. May 5, 2020 at 16:32

1 Answer 1

10

You have to install packages with versions specified:

sudo apt-get install libpcre3=2:8.39-12build1 libpcre3-dev=2:8.39-12build1

This happened because of the following: some time ago you have installed libpcre3 from PPA, but the PPA is now removed or disabled.

5
  • I love you <3 <3 May 5, 2020 at 16:36
  • @AymaneShuichi Please mark N0rbert's answer as correct if it solved your problem!
    – ldias
    May 5, 2020 at 16:37
  • I need to wait 2 minutes, I'm trying.. ok? May 5, 2020 at 16:38
  • It should work for sure.
    – N0rbert
    May 5, 2020 at 16:41
  • 1
    sudo apt-get install libpcre3 libpcre3-dev didn't work. But indeed it was a ppa issue like @N0rbert said (thanks). Therefore I did sudo add-apt-repository ppa:ondrej/php and sudo apt-get install libpcre3 libpcre3-dev works (without versions). For informationI got this error after sudo apt install r-base-dev.
    – phili_b
    Jan 29, 2021 at 11:18

You must log in to answer this question.

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