rpm -qa | grep -i <name of package> shows package installed. rpm -e says package isn't installed

RPM already installed not installed.

Today my colleague upgraded an RPM to a later version on Redhat 5.8 running version 4.4.2 of RPM and we used a verified rpm . It's a relocatable rpm and although he claims to have used the --prefix option when running rpm -Uvh the RPM installed in the default location /usr/local rather than /opt. If I verify the package with rpm -Vp it lists the contents of the rpm as as being successfully installed in the default location /usr/local and rpm -qa | grep -i <package> is showing it as installed. This default location isn't where it should be and the older version installed in /opt either has to be removed and a clean install performed or else upgraded. The now wants to remove the version he upgraded to and perform a clean install without bothering with the upgrade option but rpm -e <nameofpackage> says the package is not installed.  I've checked the contents of the rpm and it installs cleanly to one directory and not multiple directories so deleting the folder is an option but to perform a clean install won't work unless rpm is updated. Is there a way to force uninstallation of all version of the rpm? would rpm -ivh --nodeps?  Any help would be really appreciated.
lolaferrariAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Seth SimmonsSr. Systems AdministratorCommented:
have you tried using yum?

yum erase `rpm -qa | grep -i <name of package>`

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lolaferrariAuthor Commented:
Fantastic answer! Thank you !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.