无法清除 mysql-server-5.7

无法清除 mysql-server-5.7

我尝试使用此命令清除 mysql 并重新安装它sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server,这就是我得到的结果

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mysql-client-5.7' is not installed, so not removed
Package 'mysql-server' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libaio1 libevent-core-2.1-6
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  mysql-client-core-5.7* mysql-common* mysql-server-5.7* mysql-server-core-5.7*
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 126 MB disk space will be freed.
Do you want to continue? [Y/n] y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 177854 files and directories currently installed.)
Removing mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package mysql-server-5.7 (--remove):
 installed mysql-server-5.7 package pre-removal script subprocess returned error exit status 1
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error while cleaning up:
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
Removing mysql-client-core-5.7 (5.7.25-0ubuntu0.18.04.2) ...
dpkg: mysql-server-core-5.7: dependency problems, but removing anyway as you requested:
 mysql-server-5.7 depends on mysql-server-core-5.7 (= 5.7.25-0ubuntu0.18.04.2); however:
  Package mysql-server-core-5.7 is to be removed.

Removing mysql-server-core-5.7 (5.7.25-0ubuntu0.18.04.2) ...
Errors were encountered while processing:
 mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我注意到这一行

Errors were encountered while processing:
 mysql-server-5.7

我的问题是,我如何才能完全删除 mysql 并重新安装它?我的想法可能是因为mysql-server-5.7无法通过清除删除,这就是为什么我得到这个结果

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not going to be installed
                    Depends: mysql-client-5.7 (>= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
                    Depends: mysql-common (>= 5.8+1.0.4~) but it is not going to be installed
                    Depends: mysql-server-core-5.7 (= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

通过运行此sudo apt install mysql-server命令。

答案1

它会告诉您该做什么(尽管您需要有一点经验才能知道这一点):

The following packages have unmet dependencies:
 mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not going to be installed
                    Depends: mysql-client-5.7 (>= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
                    Depends: mysql-common (>= 5.8+1.0.4~) but it is not going to be installed
                    Depends: mysql-server-core-5.7 (= 5.7.25-0ubuntu0.18.04.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

因此,我会尝试清除除 之外的所有内容mysql-server-5.7,然后在单独的步骤中清除mysql-server-5.7

相关内容