【问题标题】:Error in installing libssl-dev and libssl1.0-dev in Ubuntu在 Ubuntu 中安装 libssl-dev 和 libssl1.0-dev 时出错
【发布时间】:2022-10-04 16:43:34
【问题描述】:

我正在尝试通过以下命令在 Ubuntu 18.04 中安装 libssl-dev 和 libssl1.0-dev:

sudo apt-get -y install build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5

我得到以下输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libssl1.0-dev' for regex 'libssl1.0'
Note, selecting 'libssl1.0.0' for regex 'libssl1.0'
Note, selecting 'libssl1.0.2' for regex 'libssl1.0'
build-essential is already the newest version (12.4ubuntu1).
libqt5x11extras5 is already the newest version (5.9.5-0ubuntu1).
libqt5x11extras5 set to manually installed.
libgl1-mesa-dev is already the newest version (20.0.8-0ubuntu1~18.04.1).
libgl1-mesa-dev set to manually installed.
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.20).
libssl1.0.0 is already the newest version (1.0.2n-1ubuntu5.10).
openssl is already the newest version (1.1.1-1ubuntu2.1~18.04.20).
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:
 libssl-dev : Conflicts: libssl1.0-dev but 1.0.2n-1ubuntu5.10 is to be installed
 libssl1.0-dev : Conflicts: libssl-dev but 1.1.1-1ubuntu2.1~18.04.20 is to be installed
E: Unable to correct problems, you have held broken packages.**

如何解决这些错误?

【问题讨论】:

    标签: linux ubuntu libssl


    【解决方案1】:

    在 Ubuntu 上安装 libssl1.0-dev 有三种方法。我们可以使用 apt-get、apt 和 aptitude。在以下部分中,我们将描述每种方法。您可以选择其中之一。

    使用 apt-get 安装 libssl1.0-dev

    sudo apt-get update
    sudo apt-get -y install libssl1.0-dev
    

    使用 apt 安装 libssl1.0-dev

    sudo apt update
    sudo apt -y install libssl1.0-dev
    

    使用 aptitude 安装 libssl1.0-dev

    sudo aptitude update
    sudo aptitude -y install libssl1.0-dev
    

    【讨论】:

      【解决方案2】:

      以下命令序列应该可以解决依赖关系。

      $ sudo apt-get install -f # 修复系统上损坏的依赖项。

      $ sudo dpkg -–configure -a # 重新配置所有解压的包。

      $ sudo apt-get install -f # 修复系统中损坏的依赖项。

      $ sudo apt-get install <package_name> # 在系统上安装包。

      【讨论】:

      • sudo dpkg –configure -a 给出错误:需要一个操作选项
      • 修正了错字。它是 --configure
      猜你喜欢
      • 1970-01-01
      • 2013-08-02
      • 2018-02-17
      • 1970-01-01
      • 2017-03-05
      • 2020-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多