Ubuntu – Can’t install python-pip

certificatesdependenciesopensslpackage-managementpip

I can't install the package. I tried it with the command 'sudo apt-get install python-pip python-dev build-essential'
and I got the output:

Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version (12.1ubuntu2).
build-essential set to manually installed.
python-dev is already the newest version (2.7.11-1).
python-dev set to manually installed.
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:
python-pip : Depends: ca-certificates but it is not going to be installed
Depends: python-pip-whl (= 8.1.1-2ubuntu0.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I also tried to install with aptitude, then I got

The following NEW packages will be installed:
ca-certificates{a} libpython-all-dev{a} openssl{ab} python-all{a}
python-all-dev{a} python-pip python-pip-whl{a} python-wheel{a}
0 packages upgraded, 8 newly installed, 0 to remove and 3 not upgraded.
Need to get 1,988 kB of archives. After unpacking 3,537 kB will be used.
The following packages have unmet dependencies:
openssl : Depends: libssl1.0.0 (>= 1.0.2g) but 1.0.2d-1 is installed.
The following actions will resolve these dependencies:

 Keep the following packages at their current version:

1) ca-certificates [Not Installed]
2) openssl [Not Installed]
3) python-pip [Not Installed]
4) python-pip-whl [Not Installed]

Accept this solution? [Y/n/q/?]

I typed Y, then I got

No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

I referred the following links if it would work but didn't work

Ubuntu 14.04, problem when install gstreamer1.0-libav, unmet dependencies

How do I resolve unmet dependencies after adding a PPA?

Ubuntu unable to install any packages, held broken packages

Sorry I don't know what I did but looks like I really messed up. But I was able to directly install packages such as numpy, etc directly via apt-get

Best Answer

You broke your system by unwisely installing software from a non-Ubuntu source.

Lots of good clues in the error message:

openssl : Depends: libssl1.0.0 (>= 1.0.2g) but 1.0.2d-1 is installed

libssl1.0.0 1.0.2g is in the Ubuntu 16.04 repositories.

libssl1.0.0 1.0.2d-1 is not in Ubuntu (nor Debian). You installed it from somewhere else.

To fix the problem, disable the non-Ubuntu source. Then uninstall ALL packages from that source. Refresh your package database (sudo apt update) because your sources have changed. Test your package manager for proper function (sudo apt upgrade). Then re-install the packages you need from the Ubuntu repositories.

Related Question