Home > Mobile >  Error in installing libssl-dev and libssl1.0-dev in Ubuntu
Error in installing libssl-dev and libssl1.0-dev in Ubuntu

Time:10-04

I am trying to install libssl-dev and libssl1.0-dev in Ubuntu 18.04 via the following command:

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

I am getting the following output:

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.**

How do I solve these errors?

CodePudding user response:

There are three ways to install libssl1.0-dev on Ubuntu. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libssl1.0-dev Using apt-get

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

Install libssl1.0-dev Using apt

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

Install libssl1.0-dev Using aptitude

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

CodePudding user response:

The following sequence of commands should work to resolve dependencies.

$ sudo apt-get install -f # Fix broken dependencies on your system.

$ sudo dpkg –configure -a # Reconfigure all unpacked packages.

$ sudo apt-get install -f # Fix broken dependencies in your system.

$ sudo apt-get install <package_name> # Install package on the system.

  • Related