Ubuntu上libpcre2开发依赖项未得到满足的问题



我的问题是我想在ubuntu上安装OwnCloud,长话短说,我不得不将PHP从v8降级到v7.2,我发现问题

老实说,我真的不知道确切的问题,但当我运行升级命令时,例如,我得到了这个错误

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpcre2-dev : Depends: libpcre2-posix2 (= 10.39-2+ubuntu21.10.1+deb.sury.org+1) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

即使当我运行apt-fix breaked install命令时,我也会收到以下消息:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
libpcre2-posix3
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libpcre2-posix2
The following NEW packages will be installed:
libpcre2-posix2
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
12 not fully installed or removed.
Need to get 0 B/8,300 B of archives.
After this operation, 33.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 251030 files and directories currently installed.)
Preparing to unpack .../libpcre2-posix2_10.39-2+ubuntu21.10.1+deb.sury.org+1_amd64.deb ...
Unpacking libpcre2-posix2:amd64 (10.39-2+ubuntu21.10.1+deb.sury.org+1) ...
dpkg: error processing archive /var/cache/apt/archives/libpcre2-posix2_10.39-2+ubuntu21.10.1+deb.sury.
org+1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libpcre2-posix.so.3', which is also in package libpcre
2-posix3:amd64 10.37-0ubuntu2
Errors were encountered while processing:
/var/cache/apt/archives/libpcre2-posix2_10.39-2+ubuntu21.10.1+deb.sury.org+1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我想解决这个问题,但最重要的是,我想了解更多关于Linux的信息,所以任何解释都非常受欢迎。非常感谢。

我的情况正好相反(posix3而不是posix2(:

The following package was automatically installed and is no longer required:
libpcre2-posix2
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
libpcre2-posix3
The following NEW packages will be installed:
libpcre2-posix3

这对我来说是有效的。(对你来说是libpcre2-posix3(

sudo dpkg --purge libpcre2-posix2
sudo apt --fix-broken install

之后一切都很好。

希望这能有所帮助。

我早些时候想要降级php8.0时也遇到了同样的问题->php7.4.

以下命令解决了问题:

srcFile="/etc/apt/sources.list.d/ondrej-ubuntu-php-impish.list"
sed -i 's/# //g' ${srcFile}
apt update
apt autoclean
apt autoremove -f -y 

如果一切顺利,但仍需要php7.2,请参阅下面的内容:


  1. 如果您使用的是php gearman,则需要添加ppa:ondrej/pkg gearman
  2. 如果您正在使用apache2,建议您添加ppa:ondrej/apache2
  3. 如果您使用的是nginx,建议您添加ppa:ondrej/nginx mainline

安装php7.2:

LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php <<< "2"
apt install php7.2 -y

相关内容

  • 没有找到相关文章

最新更新