无法清除 PhpMyAdmin - 已尝试许多其他删除命令

无法清除 PhpMyAdmin - 已尝试许多其他删除命令

因此,我尝试删除 PhpMyAdmin 已经有一段时间了,我尝试了许多其他命令来尝试删除它,但都没有奏效。这是我的输出sudo apt-get purge phpmyadmin

Reading package lists... Done
Building dependency tree
Reading state information... Done
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 ... 161372 files and directories currently installed.)
Removing phpmyadmin (4:4.6.6-5) ...
/var/lib/dpkg/info/phpmyadmin.prerm: 5: .: Can't open /usr/share/dbconfig-common/dpkg/prerm.mysql
dpkg: error processing package phpmyadmin (--remove):
 installed phpmyadmin package pre-removal script subprocess returned error exit status 2
/var/lib/dpkg/info/phpmyadmin.postinst: 51: .: Can't open /usr/share/dbconfig-common/dpkg/postinst.mysql
dpkg: error while cleaning up:
 installed phpmyadmin package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)

接下来,我尝试:sudo apt-get purge phpmyadmin,结果返回:

Reading package lists... Done
Building dependency tree
Reading state information... Done
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 ... 161372 files and directories currently installed.)
Removing phpmyadmin (4:4.6.6-5) ...
/var/lib/dpkg/info/phpmyadmin.prerm: 5: .: Can't open /usr/share/dbconfig-common/dpkg/prerm.mysql
dpkg: error processing package phpmyadmin (--remove):
 installed phpmyadmin package pre-removal script subprocess returned error exit status 2
/var/lib/dpkg/info/phpmyadmin.postinst: 51: .: Can't open /usr/share/dbconfig-common/dpkg/postinst.mysql
dpkg: error while cleaning up:
 installed phpmyadmin package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)

以下命令几乎返回相同的结果:apt-get remove --purge phpmyadmin

还尝试过:sudo rm -r -f phpmyadmin-但也不起作用。

我使用该locate phpmyadmin命令并:

/etc/phpmyadmin
/etc/phpmyadmin/apache.conf
/etc/phpmyadmin/conf.d
/etc/phpmyadmin/config.footer.inc.php
/etc/phpmyadmin/config.header.inc.php
/etc/phpmyadmin/config.inc.php
/etc/phpmyadmin/htpasswd.setup
/etc/phpmyadmin/lighttpd.conf
/etc/phpmyadmin/phpmyadmin.desktop
/etc/phpmyadmin/phpmyadmin.service
/usr/share/dbconfig-common/data/phpmyadmin
/usr/share/dbconfig-common/data/phpmyadmin/install
/usr/share/dbconfig-common/data/phpmyadmin/upgrade
/usr/share/dbconfig-common/data/phpmyadmin/install/mysql
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql/4:3.3.2-2
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql/4:3.4.0-2
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql/4:3.5.6-1
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql/4:4.0.1-1
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql/4:4.1.7-1
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql/4:4.2.0-1
/usr/share/dbconfig-common/data/phpmyadmin/upgrade/mysql/4:4.5.0.2-1
/usr/share/dbconfig-common/scripts/phpmyadmin
/usr/share/dbconfig-common/scripts/phpmyadmin/upgrade
/usr/share/dbconfig-common/scripts/phpmyadmin/upgrade/mysql
/usr/share/dbconfig-common/scripts/phpmyadmin/upgrade/mysql/4:4.5.0.1-1
/usr/share/doc/phpmyadmin
/usr/share/doc/phpmyadmin/CONTRIBUTING.md
/usr/share/doc/phpmyadmin/NEWS.Debian.gz
/usr/share/doc/phpmyadmin/README
/usr/share/doc/phpmyadmin/README.Debian.gz
/usr/share/doc/phpmyadmin/TODO.Debian
/usr/share/doc/phpmyadmin/changelog.Debian.gz
/usr/share/doc/phpmyadmin/copyright
/usr/share/doc/phpmyadmin/examples
/usr/share/doc/phpmyadmin/html
/usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php
/usr/share/doc/phpmyadmin/examples/config.sample.inc.php.gz
/usr/share/doc/phpmyadmin/examples/create_tables.sql
/usr/share/doc/phpmyadmin/examples/openid.php.gz
/usr/share/doc/phpmyadmin/examples/signon-script.php
/usr/share/doc/phpmyadmin/examples/signon.php
/usr/share/doc/phpmyadmin/html/_images
/usr/share/doc/phpmyadmin/html/_sources
/usr/share/doc/phpmyadmin/html/_static
/usr/share/doc/phpmyadmin/html/config.html
/usr/share/doc/phpmyadmin/html/copyright.html
/usr/share/doc/phpmyadmin/html/credits.html
/usr/share/doc/phpmyadmin/html/developers.html
/usr/share/doc/phpmyadmin/html/faq.html
/usr/share/doc/phpmyadmin/html/genindex.html
/usr/share/doc/phpmyadmin/html/glossary.html
/usr/share/doc/phpmyadmin/html/import_export.html
/usr/share/doc/phpmyadmin/html/index.html
/usr/share/doc/phpmyadmin/html/intro.html
/usr/share/doc/phpmyadmin/html/objects.inv
/usr/share/doc/phpmyadmin/html/other.html
/usr/share/doc/phpmyadmin/html/privileges.html
/usr/share/doc/phpmyadmin/html/require.html
/usr/share/doc/phpmyadmin/html/search.html
/usr/share/doc/phpmyadmin/html/searchindex.js
/usr/share/doc/phpmyadmin/html/setup.html
/usr/share/doc/phpmyadmin/html/transformations.html
/usr/share/doc/phpmyadmin/html/user.html
/usr/share/doc/phpmyadmin/html/vendors.html
/usr/share/doc/phpmyadmin/html/_images/usergroups.png
/usr/share/doc/phpmyadmin/html/_sources/config.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/config.txt
/usr/share/doc/phpmyadmin/html/_sources/copyright.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/copyright.txt
/usr/share/doc/phpmyadmin/html/_sources/credits.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/credits.txt
/usr/share/doc/phpmyadmin/html/_sources/developers.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/developers.txt
/usr/share/doc/phpmyadmin/html/_sources/faq.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/faq.txt
/usr/share/doc/phpmyadmin/html/_sources/glossary.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/glossary.txt
/usr/share/doc/phpmyadmin/html/_sources/import_export.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/import_export.txt
/usr/share/doc/phpmyadmin/html/_sources/index.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/index.txt
/usr/share/doc/phpmyadmin/html/_sources/intro.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/intro.txt
/usr/share/doc/phpmyadmin/html/_sources/other.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/other.txt
/usr/share/doc/phpmyadmin/html/_sources/privileges.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/privileges.txt
/usr/share/doc/phpmyadmin/html/_sources/require.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/require.txt
/usr/share/doc/phpmyadmin/html/_sources/setup.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/setup.txt
/usr/share/doc/phpmyadmin/html/_sources/transformations.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/transformations.txt
/usr/share/doc/phpmyadmin/html/_sources/user.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/user.txt
/usr/share/doc/phpmyadmin/html/_sources/vendors.rst.txt
/usr/share/doc/phpmyadmin/html/_sources/vendors.txt
/usr/share/doc/phpmyadmin/html/_static/ajax-loader.gif
/usr/share/doc/phpmyadmin/html/_static/basic.css
/usr/share/doc/phpmyadmin/html/_static/classic.css
/usr/share/doc/phpmyadmin/html/_static/comment-bright.png
/usr/share/doc/phpmyadmin/html/_static/comment-close.png
/usr/share/doc/phpmyadmin/html/_static/comment.png
/usr/share/doc/phpmyadmin/html/_static/default.css
/usr/share/doc/phpmyadmin/html/_static/doctools.js
/usr/share/doc/phpmyadmin/html/_static/down-pressed.png
/usr/share/doc/phpmyadmin/html/_static/down.png
/usr/share/doc/phpmyadmin/html/_static/file.png
/usr/share/doc/phpmyadmin/html/_static/jquery.js
/usr/share/doc/phpmyadmin/html/_static/minus.png
/usr/share/doc/phpmyadmin/html/_static/plus.png
/usr/share/doc/phpmyadmin/html/_static/pygments.css
/usr/share/doc/phpmyadmin/html/_static/searchtools.js
/usr/share/doc/phpmyadmin/html/_static/sidebar.js
/usr/share/doc/phpmyadmin/html/_static/underscore.js
/usr/share/doc/phpmyadmin/html/_static/up-pressed.png
/usr/share/doc/phpmyadmin/html/_static/up.png
/usr/share/doc-base/phpmyadmin
/usr/share/icons/hicolor/16x16/apps/phpmyadmin.png
/usr/share/icons/hicolor/32x32/apps/phpmyadmin.png
/usr/share/icons/hicolor/48x48/apps/phpmyadmin.png
/usr/share/lintian/overrides/phpmyadmin
/var/crash/phpmyadmin.0.crash
/var/lib/dpkg/info/phpmyadmin.conffiles
/var/lib/dpkg/info/phpmyadmin.config
/var/lib/dpkg/info/phpmyadmin.list
/var/lib/dpkg/info/phpmyadmin.md5sums
/var/lib/dpkg/info/phpmyadmin.postinst
/var/lib/dpkg/info/phpmyadmin.postrm
/var/lib/dpkg/info/phpmyadmin.prerm
/var/lib/dpkg/info/phpmyadmin.templates

答案1

缺少删除前和安装后脚本。

您可以尝试这个解决方法:

echo | sudo tee /usr/share/dbconfig-common/dpkg/prerm.mysql
echo | sudo tee /usr/share/dbconfig-common/dpkg/postinst.mysql
sudo apt-get install -f
sudo apt-get remove --purge phpmyadmin

更多信息,请参阅Ubuntu 官方文档>程序包管理器故障排除程序

相关内容