Error Installing OPcache

Asked 2 years ago, Updated 2 years ago, 79 views

I want to deploy OPcache, but the installation fails and I can't proceed.
yum-y install --enablerepo=epel, remi, remi-php71php-opcachephp-pecl-apcu
If you do the above, you will receive the following error:What should I do?

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5kB 00:00:00
1416 packages excluded due to repository priority protection
Resolving Dependencies
-->Running transaction check
--- Package php-opcache.x86_640: 7.1.28-1.el6.remi will be installed
-->Processing Dependency:php-common(x86-64) = 7.1.28-1.el6.remi for package:php-opcache-7.1.28-1.el6.remi.x86_64
--- Package php-pecl-apcu.x86_640: 5.1.17-1.el6.remi.7.1 will be installed
-- > Finished Dependency Resolution
Error: Package: php-opcache-7.1.28-1.el6.remi.x86_64 (remi-php71)
           Requirements: php-common (x86-64) = 7.1.28-1.el6.remi
           Available: php-common-5.3.29-1.8.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.3.29-1.8.amzn1
           Available: php54-common-5.4.45-1.75.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.4.45-1.75.amzn1
           Available: php55-common-5.5.38-2.119.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.5.38-2.119.amzn1
           Available: php56-common-5.6.35-1.137.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.6.35-1.137.amzn1
           Available: php56-common-5.6.36-1.138.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.36-1.138.amzn1
           Available: php56-common-5.6.37-1.139.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.37-1.139.amzn1
           Available: php56-common-5.6.38-1.140.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.38-1.140.amzn1
           Available: php56-common-5.6.39-1.141.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.39-1.141.amzn1
           Available: php56-common-5.6.40-1.142.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.40-1.142.amzn1
 You could try using -- skip-broken to work around the problem
 You could try running: rpm-Va --nofiles --nodigest

Additional note
OS: Amazon Linux AMI release 2017.09
PHP:PHP 7.1.25

#yum repolist
Loaded plugins: priorities, update-motd, upgrade-helper
92 packages excluded due to repository priority protection
repo id repo name status
!amzn-main/latest amzn-main-base 5,934
!amzn-updates/latestamzn-updates-Base 2,097
remi-php71 Remi's PHP 7.1 RPM repository for Enterprise Linux 6-x86_64307+76
remi-safe Safe Remi's RPM repository for Enterprise Linux 6-x86_642,793+16
repolist —11,131

php linux yum

2022-09-29 22:49

3 Answers

I solved myself.
Since it's Amazon Linux, it's better to use amzn-updates and amzn-main instead of remi.
I was able to install it below.

 sudo yum install php71-opcache
sudo yum install php71-pecl-apcu


2022-09-29 22:49

php-opcache dependency package php-common is required, so I tried to install it automatically, but

Resolving Dependencies
-->Processing Dependency:php-common(x86-64) = 7.1.28-1.el6.remi for package:php-opcache-7.1.28-1.el6.remi.x86_64

Multiple versions are in the candidate state and cannot be resolved.

Error: Package: php-opcache-7.1.28-1.el6.remi.x86_64 (remi-php71)
           Requirements: php-common (x86-64) = 7.1.28-1.el6.remi
           Available: php-common-5.3.29-1.8.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.3.29-1.8.amzn1
           Available: php54-common-5.4.45-1.75.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.4.45-1.75.amzn1
           Available: php55-common-5.5.38-2.119.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.5.38-2.119.amzn1
           Available: php56-common-5.6.35-1.137.amzn1.x86_64 (amzn-main)
               php-common (x86-64) = 5.6.35-1.137.amzn1
           Available: php56-common-5.6.36-1.138.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.36-1.138.amzn1
           Available: php56-common-5.6.37-1.139.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.37-1.139.amzn1
           Available: php56-common-5.6.38-1.140.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.38-1.140.amzn1
           Available: php56-common-5.6.39-1.141.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.39-1.141.amzn1
           Available: php56-common-5.6.40-1.142.amzn1.x86_64 (amzn-updates)
               php-common (x86-64) = 5.6.40-1.142.amzn1

You probably need a remi repository package, so try yum with the default enabled amzn-main, amzn-updates disabled with the --disablerepo option.

yum-y install --disablerepo=\* --enablerepo=epel, remi, remi-php71php-opcachephp-pecl-apcu

Disable all repositories in --disablerepo=\*, and enable only the repositories you need in --enablerepo=....


2022-09-29 22:49

priority plug-in is enabled and amzn-main, amzn-updates is preferred.
Try adding the --nopplugins option to yum.


2022-09-29 22:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.