我在 AWS Linux 2 上运行 PHP 8.1。当我运行 yum 更新时出现以下错误:
> Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.16-46.amzn2.0.3 will be obsoleting
--> Processing Dependency: php-common(x86-64) = 5.4.16-46.amzn2.0.3 for package: php-5.4.16-46.amzn2.0.3.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.4.16-46.amzn2.0.3 for package: php-5.4.16-46.amzn2.0.3.x86_64
---> Package php-dbg.x86_64 0:8.1.26-1.amzn2 will be obsoleted
---> Package python-lockfile.noarch 1:0.9.1-4.amzn2 will be obsoleted
---> Package python-simplejson.x86_64 0:3.2.0-1.amzn2.0.2 will be obsoleted
---> Package python2-lockfile.noarch 1:0.11.0-17.el7 will be obsoleting
---> Package python2-simplejson.x86_64 0:3.11.1-1.el7 will be obsoleting
--> Finished Dependency Resolution
Error: Package: php-5.4.16-46.amzn2.0.3.x86_64 (amzn2-core)
Requires: php-common(x86-64) = 5.4.16-46.amzn2.0.3
Installed: php-common-8.1.26-1.amzn2.x86_64 (installed)
php-common(x86-64) = 8.1.26-1.amzn2
Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-43.amzn2
Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-43.amzn2.0.1
Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-43.amzn2.0.2
Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-43.amzn2.0.3
Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-43.amzn2.0.4
Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-45.amzn2.0.5
Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-45.amzn2.0.6
Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-46.amzn2.0.2
Available: php-common-5.4.16-46.amzn2.0.3.x86_64 (amzn2-core)
php-common(x86-64) = 5.4.16-46.amzn2.0.3
Error: Package: php-5.4.16-46.amzn2.0.3.x86_64 (amzn2-core)
Requires: php-cli(x86-64) = 5.4.16-46.amzn2.0.3
Installed: php-cli-8.1.26-1.amzn2.x86_64 (installed)
php-cli(x86-64) = 8.1.26-1.amzn2
Available: php-cli-5.4.16-43.amzn2.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-43.amzn2
Available: php-cli-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-43.amzn2.0.1
Available: php-cli-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-43.amzn2.0.2
Available: php-cli-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-43.amzn2.0.3
Available: php-cli-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-43.amzn2.0.4
Available: php-cli-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-45.amzn2.0.5
Available: php-cli-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-45.amzn2.0.6
Available: php-cli-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-46.amzn2.0.2
Available: php-cli-5.4.16-46.amzn2.0.3.x86_64 (amzn2-core)
php-cli(x86-64) = 5.4.16-46.amzn2.0.3
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
我尝试删除这些包,但是系统提示它们没有安装。
yum remove php-5.4.16-46.amzn2.0.3.x86_64 php-common-5.4.16-46.amzn2.0.3.x86_64
> Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No Match for argument: php-5.4.16-46.amzn2.0.3.x86_64
No Match for argument: php-common-5.4.16-46.amzn2.0.3.x86_64
我尝试使用以下命令重建 yum 缓存:
sudo yum clean all
sudo yum makecache
sudo yum update php
但这并没有什么区别。
结果yum list installed | grep php
:
php-bcmath.x86_64 8.1.26-1.amzn2 installed
php-cli.x86_64 8.1.26-1.amzn2 installed
php-common.x86_64 8.1.26-1.amzn2 installed
php-dba.x86_64 8.1.26-1.amzn2 installed
php-dbg.x86_64 8.1.26-1.amzn2 installed
php-devel.x86_64 8.1.26-1.amzn2 installed
php-embedded.x86_64 8.1.26-1.amzn2 installed
php-enchant.x86_64 8.1.26-1.amzn2 installed
php-fpm.x86_64 8.1.26-1.amzn2 installed
php-gd.x86_64 8.1.26-1.amzn2 installed
php-gmp.x86_64 8.1.26-1.amzn2 installed
php-intl.x86_64 8.1.26-1.amzn2 installed
php-ldap.x86_64 8.1.26-1.amzn2 installed
php-mbstring.x86_64 8.1.26-1.amzn2 installed
php-mysqlnd.x86_64 8.1.26-1.amzn2 installed
php-odbc.x86_64 8.1.26-1.amzn2 installed
php-opcache.x86_64 8.1.26-1.amzn2 installed
php-pdo.x86_64 8.1.26-1.amzn2 installed
php-pear.noarch 1:1.10.13-1.amzn2 installed
php-pecl-imagick.x86_64 3.7.0-1.amzn2 installed
php-pecl-imagick-devel.noarch 3.7.0-1.amzn2 installed
php-pgsql.x86_64 8.1.26-1.amzn2 installed
php-process.x86_64 8.1.26-1.amzn2 installed
php-pspell.x86_64 8.1.26-1.amzn2 installed
php-snmp.x86_64 8.1.26-1.amzn2 installed
php-soap.x86_64 8.1.26-1.amzn2 installed
php-sodium.x86_64 8.1.26-1.amzn2 installed
php-xml.x86_64 8.1.26-1.amzn2 installed
但它们都是针对 8.1.26 的,这就是令人困惑的原因。
yum autoremove
没有效果。
yum update --obsoletes
导致同样的错误。
package-cleanup --leaves && yum update
导致同样的错误。
我错过了什么?