Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm having trouble installing php in 13.04. Seems like the package manager can't (re)configure the php package. I already tried purging every php* package, removing the cache files in /var/cache/aptbut and other solutions I've found but nothing seems to work. Here's the error output:

$ sudo dpkg --debug=12 --configure -a                                              
Setting up php5-common (5.4.9-4ubuntu2.3) ...
D000002: fork/exec /var/lib/dpkg/info/php5-common.postinst ( configure  )
dpkg: error processing php5-common (--configure):
 subprocess installed post-installation script returned error exit status 10
dpkg: dependency problems prevent configuration of php5-cli:
 php5-cli depends on php5-common (= 5.4.9-4ubuntu2.3); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-cli (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5-cgi:
 php5-cgi depends on php5-common (= 5.4.9-4ubuntu2.3); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-cgi (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5-fpm:
 php5-fpm depends on php5-common (= 5.4.9-4ubuntu2.3); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-fpm (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 php5-common
 php5-cli
 php5-cgi
 php5-fpm

sudo apt-get install -f sudo apt-get install php5-common php5 they all return the same error. How can I fix this?

share|improve this question

closed as off-topic by Jesse, Braiam, karel, guntbert, qbi Oct 21 '13 at 18:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – Jesse, Braiam, karel, guntbert, qbi
If this question can be reworded to fit the rules in the help center, please edit the question.

    
@Braiam alright. Done. –  Jesse Oct 17 '13 at 16:51
    
exactly same problem here. –  Fel Nov 3 at 16:25

1 Answer 1

Ok, there are two ways to do this:

  1. Fix it. Download the package again and unpack it:

    apt-get download php5-common
    sudo dpkg --unpack php5-common_5.4.9-4ubuntu2.3_amd64.deb
    

    (The name of the file can change) Then run apt-get -f install or sudo dpkg -a --configure.

  2. Blow it. Just remove the bad script, then run apt-get or dpkg. Warning: this could cause problems later, you should reinstall the package after doing this.

    sudo rm /var/lib/dpkg/info/php5-common.postinst
    sudo apt-get -f install || sudo dpkg --configure -a
    sudo apt-get --reinstall install php5-common
    

Why did it failed?

The reason varies from corrupted package to bad written script, but you can execute it manually and check exactly what it does.

share|improve this answer
    
I tried both of your solutions, but I keep getting the same error. Very strange :( –  Jesse Oct 18 '13 at 2:06
    
@Jesse the very same error with the debug? Can you add the content of the script? –  Braiam Oct 18 '13 at 3:47
    
I was having a hard time to fix that, and, since 13.10 is out, I decided to do a new fresh install. Should I delete this question? –  Jesse Oct 20 '13 at 23:04
    
Only flag your question, and under the "Off topic" reasons, select "a problem that can't be reproduced". Someone might find it useful later, though and deleting the question wouldn't help. –  Braiam Oct 20 '13 at 23:08

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