libpcre2-dev :依赖:libpcre2-posix3 (= 10.39-3+ubuntu20.04.1+deb.sury.org+1) 但未安装

Sky*_*der 6 20.04

我使用的是 Ubuntu 20.04,并且想做一些软件包更新。我突然收到这个错误:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libpcre2-dev : Depends: libpcre2-posix3 (= 10.39-3+ubuntu20.04.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).
Run Code Online (Sandbox Code Playgroud)

所以我运行命令: sudo apt --fix-broken install

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

它仍然失败。

有人可以在这件事上帮助我吗?

Sky*_*der 11

通过运行修复它:

sudo dpkg --purge libpcre2-posix2
Run Code Online (Sandbox Code Playgroud)

由于不再需要 libpcre2-posix2

进而

sudo apt --fix-broken install
Run Code Online (Sandbox Code Playgroud)

奇怪的是 Linux 无法自行解决这个问题。