apt upgrade
当我在 debian 服务器上执行操作时,出现以下错误:
Preparing to unpack .../phpmyadmin_4%3a4.6.6-4+deb9u1_all.deb ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dpkg: warning: subprocess old pre-removal script returned error exit status 10
dpkg: trying script from the new package instead ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dpkg: error processing archive /var/cache/apt/archives/phpmyadmin_4%3a4.6.6-4+deb9u1_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 10
dbconfig-common: flushing administrative password
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 10
Preparing to unpack .../libgssdp-1.0-3_1.0.1-1+deb9u1_amd64.deb ...
Unpacking libgssdp-1.0-3:amd64 (1.0.1-1+deb9u1) over (1.0.1-1) ...
Preparing to unpack .../libgupnp-1.0-4_1.0.1-1+deb9u1_amd64.deb ...
Unpacking libgupnp-1.0-4:amd64 (1.0.1-1+deb9u1) over (1.0.1-1) ...
Preparing to unpack .../libpq5_9.6.19-0+deb9u1_amd64.deb ...
Unpacking libpq5:amd64 (9.6.19-0+deb9u1) over (9.6.17-0+deb9u1) ...
Errors were encountered while processing:
/var/cache/apt/archives/phpmyadmin_4%3a4.6.6-4+deb9u1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试删除 phpmyadmin 但出现以下错误:
The following packages will be REMOVED:
phpmyadmin
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 24.8 MB disk space will be freed.
Do you want to continue? [Y/n]
dpkg: error processing package phpmyadmin (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:
phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)
我也做了:
apt-get clean
apt-get update && apt-get upgrade
dpkg --configure -a
apt-get -f install
但没有任何作用。
答案1
打开终端并输入:
sudo mv /var/lib/dpkg/info/phpmyadmin.* /tmp/
sudo dpkg --remove --force-remove-reinstreq phpmyadmin
sudo apt remove phpmyadmin
sudo apt autoremove
sudo apt autoclean