Sunday, March 13, 2022

[SOLVED] Why rpm told me the package is installed and not installed?

Issue

I tre to uninstall but rpm told me the package is not installed

# rpm -e *.rpm
error: package ansible-2.0.1.0-2.el6.noarch.rpm is not installed
error: package libyaml-0.1.3-4.el6_6.x86_64.rpm is not installed
error: package python-babel-0.9.4-5.1.el6.noarch.rpm is not installed
error: package python-crypto-2.0.1-22.el6.x86_64.rpm is not installed
error: package python-crypto2.6-2.6.1-2.el6.x86_64.rpm is not installed
error: package python-httplib2-0.7.7-1.el6.noarch.rpm is not installed
error: package python-jinja2-2.2.1-2.el6_5.x86_64.rpm is not installed
error: package python-jinja2-26-2.6-3.el6.noarch.rpm is not installed
error: package python-keyczar-0.71c-1.el6.noarch.rpm is not installed
error: package python-markupsafe-0.9.2-4.el6.x86_64.rpm is not installed
error: package python-paramiko-1.7.5-2.1.el6.noarch.rpm is not installed
error: package python-pyasn1-0.0.12a-1.el6.noarch.rpm is not installed
error: package python-setuptools-0.6.10-3.el6.noarch.rpm is not installed
error: package python-simplejson-2.0.9-3.1.el6.x86_64.rpm is not installed
error: package python-six-1.9.0-2.el6.noarch.rpm is not installed
error: package PyYAML-3.10-3.1.el6.x86_64.rpm is not installed
error: package sshpass-1.05-1.el6.x86_64.rpm is not installed

But when I try to install

# rpm -i *.rpm
    package python-crypto-2.0.1-22.el6.x86_64 is already installed
    package python-babel-0.9.4-5.1.el6.noarch is already installed
    package python-paramiko-1.7.5-2.1.el6.noarch is already installed
    package sshpass-1.05-1.el6.x86_64 is already installed
    package python-simplejson-2.0.9-3.1.el6.x86_64 is already installed
    package python-setuptools-0.6.10-3.el6.noarch is already installed
    package python-pyasn1-0.0.12a-1.el6.noarch is already installed
    package python-keyczar-0.71c-1.el6.noarch is already installed
    package python-httplib2-0.7.7-1.el6.noarch is already installed
    package python-crypto2.6-2.6.1-2.el6.x86_64 is already installed
    package libyaml-0.1.3-4.el6_6.x86_64 is already installed
    package PyYAML-3.10-3.1.el6.x86_64 is already installed
    package python-jinja2-2.2.1-2.el6_5.x86_64 is already installed

But the result is not installed

# ansible
bash: ansible: command not found

Why ? I already download all dependencies, try to install ansible offline.


Solution

Thu usage is:

rpm -e PACKAGE_NAME

therefore

rpm -e ansible

and NOT:

rpm -e ansible-2.0.1.0-2.el6.noarch.rpm

And syntax of rpm -i is indeed with filename, but it refuse to install newer version if there is already some installed. You should call rpm -U, so:

rpm -Uvh *.rpm

BTW: if you just want to use newest ansible on EL6 then you can use this repository: https://copr.fedorainfracloud.org/coprs/toshio/ansible-upstream/



Answered By - msuchy
Answer Checked By - Clifford M. (WPSolving Volunteer)