2
votes

in our CircleCI build, we have a few months this installation of PHP redis but it stopped to work today. The return message is below.

Please, do you know how to fix it? I am a little confused what to do. Thank you for your help.

sudo apt-get install php-redis Reading package lists... Done

Building dependency tree

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:

php-redis: Depends: php-igbinary but it is not going to be installed Dep

ends: phpapi-20160303 but it is not installable or phpapi-20151012 but it is not installable or phpapi-20131226 but it is not installable E: Unable to correct problems, you have held broken packages.

sudo apt-get install php-redis returned exit code 100

Action failed: sudo apt-get install php-redis

Our flow in CircleCi looks like this:

  • sudo apt-add-repository -y ppa:ondrej/php
  • sudo apt-get update
  • sudo apt-get install php-redis
  • echo 'extension=/usr/lib/php/20131226/redis.so' | sudo tee /opt/circleci/php/$(phpenv global)/etc/conf.d/redis.ini
  • echo 'extension=/usr/lib/php/20131226/igbinary.so' | sudo tee /opt/circleci/php/$(phpenv global)/etc/conf.d/igbinary.ini

SOLVED: use sudo apt-get -f install php-redis

1
have you tried sudo apt-get upgrade it may fix dependencies or at least suggest you run sudo apt-get -f installNigel Ren
it seems that sudo apt-get -f install works! really thank you!Petr Jirásek
You might want to SSH in and figure out why you have to force it. Other stuff could be changing as a result of that. Newer versions of Ubuntu use php7.0-redis, so you may be force-installing PHP5...ceejayoz

1 Answers

1
votes

It sounds as though there are other dependencies which are not installed by the main package. This usually happens to me when I install by dpkg (a downloaded Chrome deb package is the usual one).

When you run

sudo apt-get upgrade

It will usually tell you there has been some installation failure and suggests that you run

sudo apt-get -f install

These will usually resolve the dependencies and install any extra packages required.