无法在 Ubuntu 20.04 focal 上安装 libpcre3-dev

无法在 Ubuntu 20.04 focal 上安装 libpcre3-dev

我想

apt install libpcre3-dev

我明白了

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.

当我尝试安装 libpcre3 时:

apt install libpcre3

我明白了

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).

我该如何解决这个问题?注意,我需要安装 libpcre3-dev,因为我想从源代码构建 Nginx,从那里我得到:

./configure: 错误:HTTP 重写模块需要 PCRE 库。您可以使用 --without-http_rewrite_module 选项禁用该模块,或者将 PCRE 库安装到系统中,或者使用 --with-pcre= 选项从 nginx 源代码静态构建 PCRE 库。

根据要求,以下是输出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

答案1

您必须安装指定版本的软件包:

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

发生这种情况的原因如下:不久前您libpcre3从 PPA 安装了,但是 PPA 现在已被删除或禁用。

相关内容