2

I found that PHPMyAdmin no longer is working after I upgraded to 18.04 due to the fact that php-mcrypt is deprecated. I was getting an error about that package. I decided to remove phpmyadmin and try installing it fresh.

Here are my attempts:

balter@spectre:/etc/apache2/mods-enabled$ sudo dpkg-reconfigure phpmyadmin
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
balter@spectre:/etc/apache2/mods-enabled$ sudo apt-get purge phpmyadmin*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'phpmyadmin' for glob 'phpmyadmin*'
The following packages were automatically installed and are no longer required:
  dbconfig-common dbconfig-mysql libjs-sphinxdoc php-bz2 php-phpseclib php-tcpdf php7.2-bz2
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  phpmyadmin*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 25.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 84795 files and directories currently installed.)
Removing phpmyadmin (4:4.6.6-5) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package phpmyadmin (--remove):
 installed phpmyadmin package pre-removal script subprocess returned error exit status 1
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error while cleaning up:
 installed phpmyadmin package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)
balter@spectre:/etc/apache2/mods-enabled$ sudo apt-get remove phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dbconfig-common dbconfig-mysql libjs-sphinxdoc php-bz2 php-phpseclib php-tcpdf php7.2-bz2
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  phpmyadmin
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 25.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 84795 files and directories currently installed.)
Removing phpmyadmin (4:4.6.6-5) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package phpmyadmin (--remove):
 installed phpmyadmin package pre-removal script subprocess returned error exit status 1
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error while cleaning up:
 installed phpmyadmin package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)

Attempt 1:

balter@spectre:/var/cache/debconf$ sudo rm /var/cache/debconf/*.dat
balter@spectre:/var/cache/debconf$ sudo dpkg-reconfigure phpmyadmin
/usr/sbin/dpkg-reconfigure: phpmyadmin is broken or not fully installed
balter@spectre:/var/cache/debconf$ sudo apt purge phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dbconfig-common dbconfig-mysql libjs-sphinxdoc php-bz2 php-phpseclib php-tcpdf php7.2-bz2
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  phpmyadmin*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 25.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 84795 files and directories currently installed.)
Removing phpmyadmin (4:4.6.6-5) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dpkg: error processing package phpmyadmin (--remove):
 installed phpmyadmin package pre-removal script subprocess returned error exit status 10
dbconfig-common: flushing administrative password
dpkg: error while cleaning up:
 installed phpmyadmin package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)
balter@spectre:/var/cache/debconf$ sudo apt remove phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dbconfig-common dbconfig-mysql libjs-sphinxdoc php-bz2 php-phpseclib php-tcpdf php7.2-bz2
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  phpmyadmin
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 25.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 84795 files and directories currently installed.)
Removing phpmyadmin (4:4.6.6-5) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dpkg: error processing package phpmyadmin (--remove):
 installed phpmyadmin package pre-removal script subprocess returned error exit status 10
dbconfig-common: flushing administrative password
dpkg: error while cleaning up:
 installed phpmyadmin package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)

Attempt 2

balter@spectre:/var/cache/debconf$ sudo apt autoremove
[sudo] password for balter:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up phpmyadmin (4:4.6.6-5) ...
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
Replacing config file /etc/dbconfig-common/phpmyadmin.conf with new version
Replacing config file /etc/phpmyadmin/config-db.php with new version
dbconfig-common: flushing administrative password
dpkg: error processing package phpmyadmin (--configure):
 installed phpmyadmin package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)

1 Answer 1

5

Looked at this error

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

You need to solve this before re-install phpmyadmin.

Run this command to clear it.

sudo rm /var/cache/debconf/*.dat 

Edit

Based on attempt 2 error

dpkg: error processing package phpmyadmin (--remove): installed phpmyadmin package pre-removal script subprocess returned error exit status 10

We can remove the dpkg files manually by running below code:

rm -r /var/lib/dpkg/info/phpmyadmin.*

More details can be found on Trying to uninstall phpmyadmin "dpkg: error while cleaning up:"

6
  • See "Attempt 1" in original post.
    – abalter
    Jul 13, 2018 at 3:42
  • did you run sudo apt autoremove ?
    – John Joe
    Jul 13, 2018 at 4:06
  • See "Attempt 2" :)
    – abalter
    Jul 13, 2018 at 4:12
  • 1
    Bingo! Please update answer so I can accept.
    – abalter
    Jul 13, 2018 at 7:31
  • 1
    answer edited..
    – John Joe
    Jul 13, 2018 at 8:10

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.