we are trying to install the following rpm without success on rhel 7.2 server

 uname -r

yum install  python2-cryptography-1.7.2-2.el7.x86_64.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
--> Processing Dependency: python-cffi >= 1.4.1 for package: python2-cryptography-1.7.2-2.el7.x86_64
--> Processing Dependency: python-idna >= 2.0 for package: python2-cryptography-1.7.2-2.el7.x86_64
--> Processing Dependency: python-pyasn1 >= 0.1.8 for package: python2-cryptography-1.7.2-2.el7.x86_64
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: python2-cryptography-1.7.2-2.el7.x86_64
--> Processing Dependency: python-ipaddress for package: python2-cryptography-1.7.2-2.el7.x86_64
--> Finished Dependency Resolution
Error: Package: python2-cryptography-1.7.2-2.el7.x86_64 (/python2-cryptography-1.7.2-2.el7.x86_64)
           Requires: python-ipaddress
Error: Package: python2-cryptography-1.7.2-2.el7.x86_64 (/python2-cryptography-1.7.2-2.el7.x86_64)
           Requires: libcrypto.so.10(OPENSSL_1.0.2)(64bit)
Error: Package: python2-cryptography-1.7.2-2.el7.x86_64 (/python2-cryptography-1.7.2-2.el7.x86_64)
           Requires: python-cffi >= 1.4.1
           Available: python-cffi-0.8.6-2.el7.x86_64 (local)
               python-cffi = 0.8.6-2.el7
Error: Package: python2-cryptography-1.7.2-2.el7.x86_64 (/python2-cryptography-1.7.2-2.el7.x86_64)
           Requires: python-pyasn1 >= 0.1.8
           Available: python-pyasn1-0.1.6-2.el7.noarch (local)
               python-pyasn1 = 0.1.6-2.el7
Error: Package: python2-cryptography-1.7.2-2.el7.x86_64 (/python2-cryptography-1.7.2-2.el7.x86_64)
           Requires: python-idna >= 2.0
You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
containerd.io-1.2.13-3.1.el7.x86_64 has installed conflicts containerd: containerd.io-1.2.13-3.1.el7.x86_64
containerd.io-1.2.13-3.1.el7.x86_64 has installed conflicts runc: containerd.io-1.2.13-3.1.el7.x86_64

since we get pre-existing rpmdb problem(s)

we performed the follwing

package-cleanup --dupes
package-cleanup --cleandupes 

but the problem still remained

also what we found that the python packages that yum Requires are actually installed


pip list | grep idna
idna                               2.10

pip list | grep  pyasn1
pyasn1                             0.1.9

so we not understand why yum complained when python packages are already installed with the right version


You seem to be using pip as well as yum to install packages. The packages installed by pip would not be visible to yum, which would be the reason why your installation is failing.

This article on opensource.com explains the concerns well: Managing Python packages the right way. I will summarize the key information here.

When you install a package globally using pip (with sudo pip install), you install the package to a system-level location normally controlled by the OS package manager. However, the package manager is unaware of the package, which makes the installation inconsistent with the database of installed packages. In extreme cases, this can cause problems with system-level applications that rely on Python (such as yum itself).

In general, when installing a Python module globally, you should prefer the system's native package manager. These packages are tested with the specific version of the OS, so they should be more reliable.

If you really want to use pip to install a package, using virtual environments is recommended. With virtualenv, you get a local installation that you can modify as you see fit. You can install any package that you require, without risking the integrity of the system as a whole.

As always, there are trade-offs between both approaches. Evaluate them carefully before you proceed.

In your specific case, you may be able to proceed by removing the module with pip, and then reinstalling it via yum. I cannot guarantee that this would work, so use caution and test the approach first.

Regarding the actual package, I was able to find a listing for CentOS 7. On RHEL, you might need the Software Collections repository to get this package. Once again, ensure that you actually have the RPM package available over some channel before you decide to proceed with this route.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.