Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rpm -i says already installed, but rpm -e says not installed

Tags:

centos

rpm

jmeter

I'm trying to test out an RPM I wrote for Jmeter on CentOS. I followed some guides online and when I do 'sudo rpm --install jmeter.i386.rpm' it says the package is already installed. However when I do 'sudo rpm --erase jmeter.i386.rpm' it says the package is not installed. How can I resolve this issue?

like image 475
Zeeshan Pirzada Avatar asked Jun 26 '15 22:06

Zeeshan Pirzada


People also ask

Where does RPM get installed?

Most files pertaining to RPM are kept in the /var/lib/rpm/ directory. For more information on RPM, refer to the chapter Chapter 10, Package Management with RPM. The /var/cache/yum/ directory contains files used by the Package Updater, including RPM header information for the system.


1 Answers

By using rpm --erase correctly.

--install takes an RPM.

--erase takes a package name.

So rpm -Uvh jmeter.i386.rpm is paired with rpm -e jmeter or jmeter.i386.

As an aside, generally avoid using -i/--install in favor of -U/--upgrade as it has saner behavior in many cases (and will install a package that isn't already installed just fine). Alternatively, stop using rpm entirely and just start using yum instead yum install jmeter.i386.rpm. (Yes, install works for localinstall.)

yum takes RPMs or package names (that are in the configured repositories) for installation and takes package names for removal.

like image 124
Etan Reisner Avatar answered Oct 02 '22 14:10

Etan Reisner