在Ubuntu 16.04上,php和libssl1.1安装失败

5

我一直在使用Ubuntu 16.04。最近,我对我的PHP安装进行了一些实验,但恐怕出现了严重问题。我尝试过……

sudo apt install php7.0

但它显示了依赖和损坏的软件包错误。
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:
 php7.0 : Depends: libapache2-mod-php7.0 but it is not going to be installed or
                   php7.0-fpm but it is not going to be installed or
                   php7.0-cgi but it is not going to be installed
          Depends: php7.0-common but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

在此之后,我运行了

sudo apt install php7.0-common

响应如下:

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:
 php7.0-common : Depends: libssl1.1 (>= 1.1.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

看起来缺少依赖 libssl1.1,我已经尝试手动安装:

sudo apt install libssl1.1

以下是回应内容

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libssl1.1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libssl1.1' has no installation candidate

我现在有点困扰。我是不是把我的操作系统彻底弄崩了?

2个回答

23

我通过手动安装libssl来解决了这个问题。

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb

对于ARM系统,请使用以下命令:wget http://launchpadlibrarian.net/367327970/libssl1.1_1.1.0g-2ubuntu4_arm64.deb sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_arm64.deb - undefined

0

我在22.04 LTS中遇到了这个问题,最终编写了以下脚本来安装它,因为我用来设置系统的工具之一需要它。

希望其他人也会发现这个有用。

# Find the most recent 1.1 libssl package in the ubuntu archives
BASE_URL='http://archive.ubuntu.com/ubuntu/pool/main/o/openssl'
FILE="$( # The get parameters in the URL sort the results by descending chronological order
    curl -s "${BASE_URL}/?C=M;O=D" $(\
        # Make sure all tags are on separate lines - makes grep-work later easier \
        ) | tr '>' '>\n' $(\
        # extract all the unique links on the page \
        ) | grep 'href' | sed 's/^.*href="\([^"]*\)".*$/\1/p' | awk '!a[$0]++' $(\
        # pick the most relevant items on the list (libssl 1.1 for amd64 arch) \
        ) | grep "libssl" | grep "1.1_" | grep "amd64.deb" $(\
        # choose only the last one \
        ) | tail -1 )"
# Grab the file and if download was successful, install it with sudo
wget "${URL_BASE}/${FILE}" && sudo dpkg -i "./${FILE}"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接