Solved

rpm -e does not work

Posted on 2000-05-13
8
171 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

One of the most frequently asked questions on EE in the "Windows Installer" zone is how to eliminate self-triggered installation of some product.  The problem occurs when, suddenly, whenever a certain application is launched, or even when a folder i…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

840 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