在Kubuntu 22.04中安装php8.2-dev时遭遇依赖包冲突(held broken packages)问题的求助
在Kubuntu 22.04中安装php8.2-dev时遭遇依赖包冲突(held broken packages)问题的求助
我在Kubuntu 22.04上尝试安装php8.2-dev包时,遇到了依赖包损坏/冲突的问题,具体操作过程和错误信息如下:
操作过程与错误日志
1. 更新软件源
root@master-at-home:/mnt/_work_sdb8/wwwroot/lar/NewsPublisher# sudo apt-get update Hit:1 http://packages.microsoft.com/repos/code stable InRelease Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease Hit:3 http://ua.archive.ubuntu.com/ubuntu jammy InRelease Hit:4 https://download.docker.com/linux/ubuntu jammy InRelease Hit:5 http://repo.mysql.com/apt/ubuntu jammy InRelease Hit:6 https://deb.nodesource.com/node_20.x jammy InRelease Ign:7 https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 InRelease Hit:8 https://deb.opera.com/opera-stable stable InRelease Hit:9 https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 Release Hit:10 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease Reading package lists... Done
2. 执行系统升级
root@master-at-home:/mnt/_work_sdb8/wwwroot/lar/NewsPublisher# sudo apt-get upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: appmenu-gtk-module-common jsonlint libappmenu-gtk3-parser0 php-composer-ca-bundle php-composer-metadata-minifier php-composer-pcre php-composer-semver php-composer-spdx-licenses php-composer-xdebug-handler php-intl php-json-schema php-react-promise php-symfony-console php-symfony-process php-symfony-string php8.1-intl php8.2-mongodb Use 'sudo apt autoremove' to remove them. The following packages have been kept back: libapache2-mod-php mysql-common mysql-server php-bz2 php-intl php-mbstring php-mcrypt php-mysql php-pgsql php-xml php8.2-mcrypt 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
3. 尝试安装php8.2-dev失败
root@master-at-home:/mnt/_work_sdb8/wwwroot/lar/NewsPublisher# sudo apt install php8.2-dev Reading package lists... Done Building dependency tree... Done 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: libssl-dev : Depends: libssl3 (= 3.0.2-0ubuntu1) but 3.0.2-0ubuntu1.10 is to be installed E: Unable to correct problems, you have held broken packages.
4. 尝试aptitude安装仍失败
我尝试了网上找到的方法,使用aptitude安装,但还是遇到同样的依赖错误:
sudo aptitude install php8.2-dev
系统与已安装包信息
系统内核信息
uname -a Linux master-at-home 6.2.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
已安装的libssl3版本
apt list --installed libssl3 Listing... Done libssl3/now 3.0.2-0ubuntu1.10 amd64 [installed,local] libssl3/now 3.0.2-0ubuntu1.10 i386 [installed,local]
dpkg查询libssl3详细信息
# dpkg -s libssl3 Package: libssl3 Status: install ok installed Priority: required Section: libs Installed-Size: 5824 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Architecture: amd64 Multi-Arch: same Source: openssl Version: 3.0.2-0ubuntu1.10 Depends: libc6 (>= 2.34), debconf (>= 0.5) | debconf-2.0 Description: Secure Sockets Layer toolkit - shared libraries This package is part of the OpenSSL project's implementation of the SSL and TLS cryptographic protocols for secure communication over the Internet. It provides the libssl and libcrypto shared libraries. Homepage: https://www.openssl.org/ Original-Maintainer: Debian OpenSSL Team <pkg-openssl-devel@alioth-lists.debian.net>
更新补充信息
补充1:检查php8.2-common与php8.2-dev源状态
切换到root用户后,查看相关包的源信息:
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/WebsocketLaravel10$ sudo -s [sudo] password for master: root@master-at-home:/mnt/_work_sdb8/wwwroot/lar/WebsocketLaravel10# apt policy php8.2-common php8.2-common: Installed: 8.2.15-1+ubuntu22.04.1+deb.sury.org+1 Candidate: 8.2.15-1+ubuntu22.04.1+deb.sury.org+1 Version table: *** 8.2.15-1+ubuntu22.04.1+deb.sury.org+1 500 500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages 100 /var/lib/dpkg/status
再次尝试安装php8.2-dev,依旧遇到libssl3依赖错误:
root@master-at-home:/mnt/_work_sdb8/wwwroot/lar/WebsocketLaravel10# apt policy php8.2-dev php8.2-dev: Installed: (none) Candidate: 8.2.15-1+ubuntu22.04.1+deb.sury.org+1 Version table: 8.2.15-1+ubuntu22.04.1+deb.sury.org+1 500 500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages root@master-at-home:/mnt/_work_sdb8/wwwroot/lar/WebsocketLaravel10# sudo apt install php8.2-dev Reading package lists... Done Building dependency tree... Done 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: libssl-dev : Depends: libssl3 (= 3.0.2-0ubuntu1) but 3.0.2-0ubuntu1.10 is to be installed
补充2:再次确认php8.2-dev源状态
apt policy php8.2-dev php8.2-dev: Installed: (none) Candidate: 8.2.15-1+ubuntu22.04.1+deb.sury.org+1 Version table: 8.2.15-1+ubuntu22.04.1+deb.sury.org+1 500 500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages
请问该如何解决这个依赖冲突的问题?
备注:内容来源于stack exchange,提问作者mstdmstd
相关产品推荐
相关产品推荐

