---我已经尝试过(两次)--- mariadb 失败后安装 mysql-server mariadb 不是问题,因为虽然它安装在这台计算机上,但所有依赖项都已被删除,如下所示。终端截图如下 https://pastebin.ubuntu.com/p/9pPQDbFzYf/情况可能类似但情况并非如此。
我已经在 synaptic 中删除了 Libmysqlclient21,因为它出现故障,试图在 synaptic 上成功卸载 MySQL 并重新安装它 synaptic UNsuccessfully,显然有一个我找不到的正在运行的 MySQL 进程,这阻止了 mysql-server-8.0 的安装( mysql-client、client-8.0、client-core-8.0、server 和 server-core-8.0 重新安装就好了)。接下来你会发现 ubuntu 终端捕获清理https://pastebin.ubuntu.com/p/pJCxYm5K2w/,以及显示与“自身”冲突的突触屏幕捕获,ps aux 报告没有运行 mysql 的实例,
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 220062 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.5ubuntu2_all.deb ...
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
Selecting previously unselected package mysql-client-core-8.0.
Preparing to unpack .../mysql-client-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-client-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../mysql-server-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-common (5.8+1.0.5ubuntu2) ...
update-alternatives: warning: alternative /etc/mysql/mysql.cnf (part of link group my.cnf) doesn't exist; removing from list of alternatives
update-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choice
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-8.0.
(Reading database ... 220262 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb (--unpack):
new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
在突触上重新安装的输出
Preconfiguring packages ...
(Reading database ... 221833 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb (--unpack):
new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not installed.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server
第二次重新安装尝试
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 220062 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.5ubuntu2_all.deb ...
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
Selecting previously unselected package mysql-client-core-8.0.
Preparing to unpack .../mysql-client-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-client-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../mysql-server-core-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-common (5.8+1.0.5ubuntu2) ...
update-alternatives: warning: alternative /etc/mysql/mysql.cnf (part of link group my.cnf) doesn't exist;
removing from list of alternatives
update-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choice
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-8.0.
(Reading database ... 220262 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb (--unpack):
new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-8.0_8.0.20-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-client-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-server-core-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Setting up mysql-client-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
ps aux命令输出,没有与 MySQL 相关的运行进程(据我所知) https://pastebin.ubuntu.com/p/z4cCYXBykW/
十分感谢
以防万一有人遇到同样的情况,这是需要考虑的事情。不明白怎么回事,我是通过具有完全管理权限的用户帐号远程访问ubuntu机器的,但是不是安装ubuntu时创建的帐号,现在我终于直接访问电脑并登录了原始帐户,令我惊讶的是,当我尝试通过突触卸载所有 MySQL 槽时,我根本没有收到警告或错误,只是为了安全起见我运行以下命令
根本没有错误或警告,所以我启动了突触并重新安装了 mysql-server(突触处理了依赖项),安装正确完成。这对我来说毫无意义,因为具有完全管理权限的用户帐户应该具有完全访问权限,但是有了它,MySQL 已安装并正在运行。