Solved

rpm -e does not work

Posted on 2000-05-13
8
168 Views
Last Modified: 2013-11-13
If I install a program with:
rpm -Uvh program-name.rpm
Then I do -i program-name.rpm
I get an error that the program is already installed.
Then I do a:
rpm -evh program-namr.rpm
and it says the program is not installed.
Why can I not uninstall programs installed with rpm?
0
Comment
Question by:davidpm
  • 4
  • 3
8 Comments
 
LVL 1

Expert Comment

by:raks04
ID: 2807988
Check if the "program-name" is the exactly as the ones u have used before for upgrading or installing.
0
 

Author Comment

by:davidpm
ID: 2808363
It is exactly the same because I'm just using the up arrow and editing the install command to be a -e command
0
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 2808532
The rpm -e is probably failing because the name of the rpm file is not the same as the name the package is installed as. Use "rpm -q package" to find out what the installed name is and use that in the "rpm -e" command.
0
 

Author Comment

by:davidpm
ID: 2808852
Hi jlevie your back and got me going in the right direction.
I usually use -U to install instead of -i, I heard it was safer as it unintalls old versions
Here is what I found out.
If to install a package I use:
rpm -Uvh samba*
it installs three packages. samba, samba-client, and samb-common.
If I run
rpm -e samba-2.0.5a-12.i386.rpm  it says samba-2.0.5a-12.i386.rpm is not installed.
If I Run rpm -Uvh samba* it says
samba-2.0.5a-12 is already installed.
Now I know the real name of the installed package which is not the same as rpm file name.
rpm -e samba-2.0.5a-12 does work
Also rpm  -qa |grep samba will give me the real name of the package

I did not however work out any syntex of the form rpm -q package-name that works unless I knew the actual package name which I do not as I only have the rpm file name.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:davidpm
ID: 2808857
After reading this I suppose I could guess that the rpm installed name is just the rpm file name less the .i386.rpm but I do not know if that is true in all cases
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2809143
Yes, -U is safer, especially when you may have that package already on the system. Also -F is better applying a series of updates. In that case the package will only be upgraded if it's already installed on the system.

And yes, while the installed name is typically similar to the the rpm file name, there's no requirement for it to be similar (or even related). As far as "rpm -U|-F|-i" is concerned the rpm file used to install, say Samba, could be named "yes-you-really-want-this". As long as the contents were a valid rpm, the parts of Samba would be installed and the package names contained within the rpm (samba, samba-client, samba-common) would be what you'd see if you did an "rpm -qa".
0
 

Author Comment

by:davidpm
ID: 2809308
Thanks for the confermation.
Tricky those RedHat guys.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2809371
Actually it makes a lot of sense although the advantages might not be obvious on first glance. Suppose that you had downloaded the rpm file using something that can't preserve the real file name. Perhaps a windows box that mangled the original name. You'd have to copy it to Linux and rename the file to be exactly as it was originally. The way it's don it doesn't matter what the file name is, the packages will still be installed correctly.

As an aside, Sun and SGI do exactly the same thing with their package system. The filenames aren't required to match the installed package names. That information is encoded into the package itself so it always comes out right.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
If you don't know how to downgrade, my instructions below should be helpful.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now