Solved

rpm -e does not work

Posted on 2000-05-13
8
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Hosting 16 75
Rebooted a CentOS 7 server and it wouldn't boot into the later Core version 5 104
Event ID 1054 Userenv 2 53
Batch File- Finding Drive Description 11 39
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

740 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