У меня возникают следующие ошибки, когда я выполняю 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
Entretoize 14 Авг 2020 в 16:25

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
2
karel 15 Авг 2020 в 12:54