无法在 ubuntu 22.04 上安装 mariadb-server

无法在 ubuntu 22.04 上安装 mariadb-server

我正在尝试在 ubuntu 22.04 LTS 上安装 mariadb-server,但收到与 galera-4 和 libssl 相关的依赖性错误消息。如何解决此问题?

Reading package lists... Done
Building dependency tree... Done
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:
galera-4 : Depends: libssl1.1 (>= 1.1.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

答案1

Ubuntu 22.04libssl-3.0.2不满足 MariaDB 的依赖要求。也就是说,您可以从 Ubuntu 服务器下载所需的库并手动安装。

就是这样:

  1. 打开终端(如果是服务器,则通过 SSH 进入机器)
  2. 下载库:
    wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
    
    
  3. 安装软件包:
    sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
    
  4. 继续你的一天

从现在起,您将能够顺利安装 MariaDB。MariaDB 的未来更新可能会通过使用较新的 libssl3.x 库来解决此依赖性问题。

答案2

就我而言,出现此问题的原因是我遵循了添加 MariaDB 存储库的指南,但添加的存储库适用于不同的操作系统。

我的问题已通过使用MariaDB repo 安装脚本,然后安装:

curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- \
  --mariadb-server-version="mariadb-10.11" --os-type="ubuntu" --os-version="jammy"

sudo apt install mariadb-server mariadb-client -y

我这样做之后,安装甚至不需要libssl1.1libreadline5

相关内容