web-dev-qa-db-ja.com

PHPMyAdminを削除できません。 Ubuntu 18.04。正常に機能しない

php-mcryptが非推奨になったため、18.04にアップグレードした後、PHPMyAdminが動作しなくなっていることがわかりました。そのパッケージに関するエラーが発生していました。 phpmyadminを削除し、新しくインストールしてみることにしました。

私の試みは次のとおりです。

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)

試行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)

試行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
abalter

このエラーを見て

debconf:DbDriver "config":/var/cache/debconf/config.datは別のプロセスによってロックされています:リソースは一時的に利用できません

phpmyadminを再インストールする前に、これを解決する必要があります。

このコマンドを実行してクリアします。

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

編集

試行2エラーに基づく

dpkg:エラー処理パッケージphpmyadmin(--remove):インストール済みphpmyadminパッケージの削除前スクリプトサブプロセスがエラー終了ステータス10を返しました

以下のコードを実行して、dpkgファイルを手動で削除できます。

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

詳細は phpmyadminをアンインストールしようとしています "dpkg:clean while cleanup:"

1
John Joe