Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just tried to upgrade my version of PHP on Ubuntu 12.04 and now I have messed it up. First I did this:

sudo add-apt-repository ppa:ondrej/php5-oldstable

Then I did this:

sudo apt-get update

Then finally I did this:

sudo apt-get install php5

And now I am getting an error message about Sub-process /usr/bin/dpkg returned an error code (1)

What have I done wrong? How can I fix this problem? Thanks.

Here are the errors received:

Do you want to continue [Y/n]? Y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Setting up libapache2-mod-php5 (5.4.28-1+deb.sury.org~precise+1) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing libapache2-mod-php5 (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Setting up php5-cli (5.4.28-1+deb.sury.org~precise+1) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing php5-cli (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of php5-curl:
 php5-curl depends on phpapi-20100525+lfs; however:
  Package phpapi-20100525+lfs is not installed.
  Package libapache2-mod-php5 which provides phpapi-20100525+lfs is not configured yet.
  Package php5-cli which provides phpapi-20100525+lfs is not configured yet.
dpkg: error processing php5-curl (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of php5-gd:
 php5-gd depends on phpapi-20100525+lfs; however:
  Package phpapi-20100525+lfs is not installed.
  Package libapache2-mod-php5 which provides phpapi-20100525+lfs is not configured yet.
  Package php5-cli which provides phpapi-20100525+lfs is not configured yet.
dpkg: error processing php5-gd (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of php5-mcrypt:
 php5-mcrypt depends on phpapi-20100525+lfs; however:
  Package phpapi-20100525+lfs is not installed.
  Package libapache2-mod-php5 which provides phpapi-20100525+lfs is not configured yet.
  Package php5-cli which provides phpapi-20100525+lfs is not configured yet.
dpkg: error processing php5-mcrypt (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of php5-mysql:
 php5-mysql depends on phpapi-20100525+lfs; however:
  Package phpapi-20100525+lfs is not installed.
  Package libapache2-mod-php5 which provides phpapi-20100525+lfs is not configured yet.
  Package php5-cli which provides phpapi-20100525+lfs is not configured yet.
dpkg: error processing php5-mysql (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of php5:
 php5 depends on libapache2-mod-php5 (>= 5.4.28-1+deb.sury.org~precise+1) | libapache2-mod-php5filter (>= 5.4.28-1+deb.sury.org~precise+1) | php5-cgi (>= 5.4.28-1+deb.sury.org~precise+1) | php5-fpm (>= 5.4.28-1+deb.sury.org~precise+1); however:
  Package libapache2-mod-php5 is not configured yet.
  Package libapache2-mod-php5filter is not installed.
  Package php5-cgi is not installed.
  Package php5-fpm is not installed.
dpkg: error processing php5 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 libapache2-mod-php5
 php5-cli
 php5-curl
 php5-gd
 php5-mcrypt
 php5-mysql
 php5
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question

1 Answer 1

I managed to fix this problem by reading the error message and seeing that:

DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable

In order to remove the lock from this file I did this:

sudo fuser -v /var/cache/debconf/config.dat

Then after doing this I learned which process was using that config.dat file. I then did the following to kill the specific process (my process was 30773):

sudo kill 30773

After doing this, I was then able to correctly install PHP by using:

sudo apt-get install php5

and everything then worked. Thanks for pointing me in the right direction.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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