Broken php and libssl1.1 installation on Ubuntu 16.04
Asked Answered
P

2

7

I have been using Ubuntu 16.04. Recently I did some experiments with my PHP installation and I'm afraid I have broken things badly. I tried

sudo apt install php7.0

But it's showing a dependency and broken package error

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.

Following this, I ran

sudo apt install php7.0-common

and the response is

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.

It seems the dependency libssl1.1 is missing so I have tried to install it manually with

sudo apt install libssl1.1

And here is the response

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

I am kinda stuck at this point. Did I break my os for good?

Pericline answered 27/6, 2021 at 5:23 Comment(0)
P
25

I have resolved the issue by installing libssl manually.

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
Pericline answered 27/6, 2021 at 6:44 Comment(1)
For arm systems use wget http://launchpadlibrarian.net/367327970/libssl1.1_1.1.0g-2ubuntu4_arm64.deb sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_arm64.debWhittle
B
0

I've encountered this issue with 22.04 LTS, ended up writing the following script for my systems to have it installed, as one of the tools I use to setup the system requires it.

Hope others find this useful.

# 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}"
Benitobenjamen answered 25/8, 2022 at 22:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.