尝试在 Ubuntu 服务器 21.04 上安装 mariadb-server 时出现错误

尝试在 Ubuntu 服务器 21.04 上安装 mariadb-server 时出现错误

当我尝试mariadb-server使用以下命令在 Ubuntu 21.04 上安装时:

sudo apt install mariadb-server

它显示了这个错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.31-0ubuntu0.20.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

答案1

MariaDB 有自己的存储库,支持 21.04...请参阅下面的链接。

https://mariadb.com/kb/en/installing-mariadb-deb-files/

答案2

你应该有一个可用包在通常的仓库中。

您收到的错误消息可能由多种原因引起。您可以尝试以下方法来解决问题或找出原因:

  1. sudo apt update安装之前。
  2. sudo apt autoremove之前update
  3. 列出保留的包裹dpkg --get-selections | grep hold(或dpkg --get-selections | grep "\<hold$"按照)。
  4. sudo apt-get -f installmariadb-server`强制安装。

来源

  1. 无法纠正问题,您持有破损的包裹

相关内容