简体   繁体   中英

libssl1.1 dependency conflict on Ubuntu 21.10

I'm new to ubuntu and I'm trying to install nodejs npm but I get the error:

The following packages have unmet dependencies: libssl-dev: Depends: libssl1.1 (= 1.1.1l-1ubuntu1) but 1.1.1l-1ubuntu1.1 is to be installed E: Unable to correct problems, you have held broken packages.

I tried to install libssl1.1 via apt but ig I'm doing something wrong. Please suggest me a right code to install the right version of libssl I need, I'm on Ubuntu 21.10.

Try these instructions. Also it's possible libssl1.1 isn't installing on your system because you have other ssl libraries already installed and are conflicting. If they were installed from PPAs for example.

I've not dug deep enough to find the reason behind the missing libssl1.1 library, but it seems the LTS 22.04 isn't including it for the time being.

I wrote 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}"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM