我的系统提议从 19.04 升级,所以我让它,但有很多错误。现在 MySQL 将无法运行。在终端中运行它:
然:sudo dpkg --remove --force-all mysql-community-client libmysqlclient21:amd64 mysql-common mysql-community-client-core
dpkg: mysql-community-client: dependency problems, but removing anyway as you requested:
dbconfig-mysql depends on default-mysql-client | virtual-mysql-client; however:
Package default-mysql-client is not installed.
Package virtual-mysql-client is not installed.
Package mysql-community-client which provides virtual-mysql-client is to be removed.
(Reading database ... 533508 files and directories currently installed.)
Removing mysql-community-client (8.0.18-1ubuntu19.10) ...
dpkg: libmysqlclient21:amd64: dependency problems, but removing anyway as you requested:
libvtk6.3 depends on libmysqlclient21 (>= 8.0.11); however:
Package libmysqlclient21:amd64 is to be removed.
libsnmp30:amd64 depends on libmysqlclient21 (>= 8.0.11).
libqt4-sql-mysql:amd64 depends on libmysqlclient21 (>= 8.0.11).
libgdal20 depends on libmysqlclient21 (>= 8.0.11).
Removing libmysqlclient21:amd64 (8.0.18-1ubuntu19.10) ...
Removing mysql-common (8.0.18-1ubuntu19.10) ...
Removing mysql-community-client-core (8.0.18-1ubuntu19.10) ...
Processing triggers for man-db (2.8.7-3) ...
Processing triggers for libc-bin (2.30-0ubuntu2) ...
然后运行:sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
dbconfig-mysql : Depends: default-mysql-client but it is not installed or
virtual-mysql-client
libgdal20 : Depends: libmysqlclient21 (>= 8.0.11) but it is not installed
libqt4-sql-mysql : Depends: libmysqlclient21 (>= 8.0.11) but it is not installed
libsnmp30 : Depends: libmysqlclient21 (>= 8.0.11) but it is not installed
libvtk6.3 : Depends: libmysqlclient21 (>= 8.0.11) but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
然:sudo dpkg --remove --force-all dbconfig-mysql;apt-get 下载 libmysqlclient21;sudo dpkg -i libmysqlclient21 .deb; sudo apt install -f*
dpkg: dbconfig-mysql: dependency problems, but removing anyway as you requested:
phpmyadmin depends on dbconfig-mysql | dbconfig-no-thanks | dbconfig-common (<< 2.0.0); however:
Package dbconfig-mysql is to be removed.
Package dbconfig-no-thanks is not installed.
Version of dbconfig-common on system is 2.0.11ubuntu2.
(Reading database ... 533425 files and directories currently installed.)
Removing dbconfig-mysql (2.0.11ubuntu2) ...
Get:1 http://repo.mysql.com/apt/ubuntu eoan/mysql-8.0 amd64 libmysqlclient21 amd64 8.0.18-1ubuntu19.10 [1,281 kB]
Fetched 1,281 kB in 8s (152 kB/s)
Selecting previously unselected package libmysqlclient21:amd64.
(Reading database ... 533424 files and directories currently installed.)
Preparing to unpack libmysqlclient21_8.0.18-1ubuntu19.10_amd64.deb ...
Unpacking libmysqlclient21:amd64 (8.0.18-1ubuntu19.10) ...
dpkg: dependency problems prevent configuration of libmysqlclient21:amd64:
libmysqlclient21:amd64 depends on mysql-common (>= 8.0.18-1ubuntu19.10); however:
Package mysql-common is not installed.
dpkg: error processing package libmysqlclient21:amd64 (--install):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.30-0ubuntu2) ...
Errors were encountered while processing:
libmysqlclient21:amd64
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
libmysqlclient21 : Depends: mysql-common (>= 8.0.18-1ubuntu19.10)
phpmyadmin : Depends: dbconfig-mysql but it is not installed or
dbconfig-no-thanks but it is not installed or
dbconfig-common (< 2.0.0) but 2.0.11ubuntu2 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
偶尔弹出的另一个错误是:
Error: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit -.mount is masked.
来自评论:
使用以下命令强制删除 MySQL 相关包
dpkg
:使用 APT 再次安装 MySQL:
我先安装
sudo apt install mysql-server
,然后再安装sudo apt install php-mysql
。我知道这很奇怪,但它确实有效。https://wiki.ubuntuusers.de/LAMP/
跑:
这将为您提供 Ubuntu Eoan (19.10) 的最新软件包。
在安装屏幕上,选择软件包:
最后,安装服务器: