dpkg: phpmyadmin 패키지 처리 중 오류가 발생했습니다.

dpkg: phpmyadmin 패키지 처리 중 오류가 발생했습니다.

apt upgradeDebian 서버에서 작업을 수행할 때 다음 오류가 발생합니다.

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

관련 정보