Solved

rpm -e does not work

Posted on 2000-05-13
8
170 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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
 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

809 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