3

I get the following error after doing sudo apt-get upgrade:

Setting up php5-cli (5.5.9+dfsg-1ubuntu4.6) ...
ucfr: Attempt from package php5-cli  to take /etc/php5/cli/php.ini away from package php5-fpm
ucfr: Aborting.
dpkg: error processing package php5-cli (--configure):
 subprocess installed post-installation script returned error exit status 4
dpkg: dependency problems prevent configuration of php5-readline:
 php5-readline depends on php5-cli (= 5.5.9+dfsg-1ubuntu4.6); however:
  Package php5-cli is not configured yet.

dpkg: error processing package php5-readline (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of php-pear:
 php-pear depends on php5-cli; however:
  Package php5-cli is not configured yet.

dpkg: error processing package php-pear (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Setting up php5 (5.5.9+dfsg-1ubuntu4.6) ...
Errors were encountered while processing:
 php5-cli
 php5-readline
 php-pear
E: Sub-process /usr/bin/dpkg returned an error code (1)

After that, I tried sudo apt-get install -f, sudo dpkg --configure -a and sudo apt-get install --reinstall php5, all of them with the same error.

How can I fixed this?

  • Try removing php5-fpm first, using dpkg -r php5-fpm – wurtel Feb 20 '15 at 8:19
7

To solve it, I had to remove the symlink in /etc/php5/cli/php.ini that points to ../fpm/php.ini.

After that, all works as expected.

I found the solution here.

  • Well, that is irritating. – threeve Aug 25 '16 at 12:35
  • This resolved my issue as well. sudo unlink php.ini – Snacking_IT Oct 24 '17 at 22:07
1

I ran into this same issue just now and this was the first result, and it didn't solve my issue, so I wanted to leave my solution here. I found a bogus file that had been created due to improperly running php5enmod in /var/lib/php5/modules/registry Once I removed the file from there that wasn't an actual php5 module everything started working.

0

this works for me

cd /var/lib/dpkg/info/

apt-cache policy php5-cli

ls -l php5-cli.*

sudo apt-get clean

sudo rm -r php5-cli.*

sudo apt-get clean

sudo apt-get update

apt-get upgrade
  • This seems incoherent. What is accomplished by showing the policy (source) of the package? The repeated apt-get clean invocations make no sense. Likewise, screwing around with php5-cli package metadata can cause further problems - do you want to remove the maintainer scripts, empty the package file list, or? It hardly makes any sense. – Josip Rodin Mar 2 '18 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.