When trying to add an extension to an existing system using our configuration management tool, we kept bumping into issues on machines having old versions of PHP, as yum would inadvertently come to the conclusion that it needed to install a newer version of the php-common
package.
This behavior can be reproduced by trying to install an older version of a php extension on a clean (no php present) system:
# yum install php-snmp-7.0.6
[...]
---> Package php-snmp.x86_64 0:7.0.6-3.el7.centos will be installed
--> Processing Dependency: php-common(x86-64) = 7.0.6-3.el7.centos for package: php-snmp-7.0.6-3.el7.centos.x86_64
--> Processing Dependency: net-snmp for package: php-snmp-7.0.6-3.el7.centos.x86_64
--> Running transaction check
---> Package net-snmp.x86_64 1:5.7.2-24.el7_2.1 will be installed
---> Package php-common.x86_64 0:7.0.6-3.el7.centos will be installed
--> Processing Dependency: php-json(x86-64) for package: php-common-7.0.6-3.el7.centos.x86_64
--> Running transaction check
---> Package php-json.x86_64 0:7.0.8-0.1.RC1.el7.centos will be installed
--> Processing Dependency: php-common(x86-64) = 7.0.8-0.1.RC1.el7.centos for package: php-json-7.0.8-0.1.RC1.el7.centos.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:7.0.6-3.el7.centos will be installed
--> Processing Dependency: php-common(x86-64) = 7.0.6-3.el7.centos for package: php-snmp-7.0.6-3.el7.centos.x86_64
---> Package php-common.x86_64 0:7.0.8-0.1.RC1.el7.centos will be installed
--> Finished Dependency Resolution
Error: Package: php-snmp-7.0.6-3.el7.centos.x86_64 (noc-php70)
Requires: php-common(x86-64) = 7.0.6-3.el7.centos
Available: php-common-5.4.16-36.el7_1.x86_64 (base)
php-common(x86-64) = 5.4.16-36.el7_1
Available: php-common-5.4.16-36.1.el7_2.1.x86_64 (updates)
php-common(x86-64) = 5.4.16-36.1.el7_2.1
Available: php-common-7.0.6-3.el7.centos.x86_64 (noc-php70)
php-common(x86-64) = 7.0.6-3.el7.centos
Available: php-common-7.0.7-1.el7.centos.x86_64 (noc-php70)
php-common(x86-64) = 7.0.7-1.el7.centos
Installing: php-common-7.0.8-0.1.RC1.el7.centos.x86_64 (noc-php70)
php-common(x86-64) = 7.0.8-0.1.RC1.el7.centos
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
diff --git a/php70.spec b/php708.spec
index a04eabd..f3c6f20 100644
--- a/php70.spec
+++ b/php708.spec
@@ -382,7 +382,7 @@ Provides: php-standard = %{version}, php-standard%{?_isa} = %{version}
Provides: php-tokenizer, php-tokenizer%{?_isa}
Provides: php-zlib, php-zlib%{?_isa}
# For user experience, those extensions were part of php-common
-Requires: php-json%{?_isa}
+Requires: php-json%{?_isa} = %{version}-%{release}
#Requires: php-zip%%{?_isa}
Obsoletes: php-pecl-phar < 1.2.4
# yum install php-snmp-7.0.6
[...]
---> Package php-snmp.x86_64 0:7.0.6-3.el7.centos will be installed
--> Processing Dependency: php-common(x86-64) = 7.0.6-3.el7.centos for package: php-snmp-7.0.6-3.el7.centos.x86_64
--> Processing Dependency: net-snmp for package: php-snmp-7.0.6-3.el7.centos.x86_64
--> Running transaction check
---> Package net-snmp.x86_64 1:5.7.2-24.el7_2.1 will be installed
---> Package php-common.x86_64 0:7.0.6-3.el7.centos will be installed
--> Processing Dependency: php-json(x86-64) = 7.0.6-3.el7.centos for package: php-common-7.0.6-3.el7.centos.x86_64
--> Running transaction check
---> Package php-json.x86_64 0:7.0.6-3.el7.centos will be installed
--> Finished Dependency Resolution