0

I was installing lamp-server^ with the command

sudo apt-get install lamp-server^

when it hung on this section:

Setting up mysql-server-5.7 (5.7.15-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto                          mode
Renaming removed key_buffer and myisam-recover options (if present)

I tried ctrl+c to no avail, and then out of habbit hit ctrl-z, which suspended it or something. Using fg it instantly exited but left dpkg in an odd locked state.

I tried,

sudo dpkg --configure -a

both before and after

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock

but to no avail. If I try --configure -a or apt-get upgrade I get this:

theelous3@compoopr:/var/lib/dpkg/updates$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
11 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
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 mysql-server-5.7 (5.7.15-0ubuntu0.16.04.1) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up php7.0-common (7.0.8-0ubuntu0.16.04.3) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package php7.0-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php7.0-json:
 php7.0-json depends on php7.0-common (= 7.0.8-0ubuntu0.16.04.3); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-json (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.0-opcache:
 php7.0-opcache depends on php7.0-common (= 7.0.8-0ubuntu0.16.04.3); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-opcache (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.0-readline:
 php7.0-readline depends on php7.0-common (= 7.0.8-0ubuntu0.16.04.3); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-readline (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.0-cli:
 php7.0-cli depends on php7.0-common (= 7.0.8-0ubuntu0.16.04.3); however:
  Package php7.0-common is not configured yet.
 php7.0-cli depends on php7.0-json; however:
  Package php7.0-json is not configured yet.
 php7.0-cli depends on php7.0-opcache; however:
  Package php7.0-opcache is not configured yet.
 php7.0-cli depends on php7.0-readline; however:
  Package php7.0-readline is not configured yet.

dpkg: error processing package php7.0-cli (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libapache2-mod-php7.0:
 libapache2-mod-php7.0 depends on php7.0-cli; however:
  Package php7.0-cli is not configured yet.
 libapache2-mod-php7.0 depends on php7.0-common (= 7.0.8-0ubuntu0.16.04.3); however:
  Package php7.0-common is not configured yet.
 libapache2-mod-php7.0 depends on php7.0-json; however:
  Package php7.0-json is not configured yet.
 libapache2-mod-php7.0 depends on php7.0-opcache; however:
  Package php7.0-opcache is not configured yet.

dpkg: error processing package libapache2-mod-php7.0 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libapache2-mod-php:
 libapache2-mod-php depends on libapache2-mod-php7.0; however:
  Package libapache2-mod-php7.0 is not configured yet.

dpkg: error processing package libapache2-mod-php (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.0-mysql:
 php7.0-mysql depends on php7.0-common (= 7.0.8-0ubuntu0.16.04.3); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-mysql (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php-mysql:
 php-mysql depends on php7.0-mysql; however:
  Package php7.0-mysql is not configured yet.

dpkg: error processing package php-mysql (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.7
 php7.0-common
 php7.0-json
 php7.0-opcache
 php7.0-readline
 php7.0-cli
 libapache2-mod-php7.0
 libapache2-mod-php
 mysql-server
 php7.0-mysql
 php-mysql
E: Sub-process /usr/bin/dpkg returned an error code (1)
1

You have left packages in an unconfigured state. You'd need to remove the lock files left from debconf, and fix unconfigured packages.

sudo rm /var/cache/debconf/*.dat sudo apt-get install -f

| improve this answer | |
  • Uh. I can't see how to edit that comment. I fixed it by manually running apt-get remove and removing all of the packages listed above, then removing the lock files as you said, and finally sudo fuser -vik /var/cache/debconf/config.dat and killed the process holding it. The apt configure and such. Ty for assist. – theelous3 Oct 23 '16 at 2:23

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.