如何在没有 `apt-get` 和 `dpkg` 的情况下从 Ubuntu 16.04 中强制删除 MySQL 和 MariaDB?

How to forcefully remove MySQL and MariaDB from Ubuntu 16.04, without `apt-get` and `dpkg`?(如何在没有 `apt-get` 和 `dpkg` 的情况下从 Ubuntu 16.04 中强制删除 MySQL 和 MariaDB?)
本文介绍了如何在没有 `apt-get` 和 `dpkg` 的情况下从 Ubuntu 16.04 中强制删除 MySQL 和 MariaDB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于错误卸载 MariaDB,我在我的 Ubuntu 16.04 中丢失了 MySQLMariaDB 的工作实例系统...

By wrong uninstalling MariaDB, I've lost working instance of MySQL and MariaDB in my Ubuntu 16.04 system...

我已经破坏了太多的依赖关系,以至于我无法使用 apt-get 卸载或安装 MySQLMariaDB,或者dpkg...

I've broken the dependencies so much, that I can not uninstall or install MySQL or MariaDB, using apt-get, or dpkg...

以下所有命令均失败:

apt-get [install -f] [update] [remove] [purge] [autorove] [clean] [check]

以及带有 dpkg 的选项,例如:

and options with dpkg such as:

dpkg --remove --force-remove-reinstreq mysql

也别帮我.

手动下载软件包并尝试从本地文件安装没有帮助.

Manually downloading the package and attempting to install from a local file did not help.

对于每次安装、卸载或其他尝试,我得到几乎相同的结果:

For each installation, uninstallation or other attempt, I get almost the same result:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 mariadb-client : Depends: mariadb-client-10.0 (>= 10.0.34-0ubuntu0.16.04.1) but it is not installed
 mariadb-server-10.0 : PreDepends: mariadb-common (>= 10.0.34-0ubuntu0.16.04.1) but it is not installed
                       Depends: mariadb-client-10.0 (>= 10.0.34-0ubuntu0.16.04.1) but it is not installed
                       Breaks: mysql-server
 mariadb-server-core-10.0 : Depends: mariadb-common (>= 10.0.34-0ubuntu0.16.04.1) but it is not installed
 mysql-server : Depends: mysql-community-server (= 5.7.22-1ubuntu16.04) but it is not installed
E: Unmet dependencies. Try using -f.

有没有什么不同的方法可以从操作系统中永久删除 MySQLMariaDB 的任何痕迹和残余,以便我可以重新安装 MySQL 本身?

Is there any different way to permanently remove any traces and remnants of MySQL and MariaDB from the operating system, so that I can reinstall MySQL itself?

我需要使用 MySQL,但我无法重新安装操作系统.

I need to working with MySQL, but I can't reinstall the operating system.

请帮帮我.

推荐答案

上帝存在!:D

问题解决了,输入:

sudo apt-get -f install

没有任何其他参数

然后通过以下方式显示所有包:

and later displaying all packages via:

sudo dpkg -l | grep mariadb
sudo dpkg -l | grep mysql

并以正确的顺序删除有问题的包:

and removing problematic packages in the right order:

sudo apt-get --purge autoremove package_name

在完全删除所有有问题的软件包后,我可以重新安装 MySQL 没有任何问题...

After the complete removal of all problematic packages, I could re-install MySQL without any problems...

感谢@YuriLachin 的帮助.

Thank you @YuriLachin for your help.

这篇关于如何在没有 `apt-get` 和 `dpkg` 的情况下从 Ubuntu 16.04 中强制删除 MySQL 和 MariaDB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Difficulties installing mysql gem on Ubuntu(在 Ubuntu 上安装 mysql gem 的困难)
Default password of mysql in ubuntu server 16.04(ubuntu server 16.04 mysql的默认密码)
MySQL is extremely slow on EC2(MySQL 在 EC2 上非常慢)
preconfigure an empty password for mysql via debconf-set-selections(通过 debconf-set-selections 为 mysql 预配置一个空密码)
How can I pass a password from a bash script to aptitude for installing mysql?(如何将密码从 bash 脚本传递到 aptitude 以安装 mysql?)
How to edit the path in odbcinst -j(如何在odbcinst-j中编辑路径)