Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create one rpm with rpmbuild which can remove some others rpm in system forcefully.

How can i integrate rpm -e --nodeps packagename.rpm command in specfile?

share|improve this question
Sounds risky. Just sayin' – Tom O'Connor Oct 31 '12 at 8:58
I know which rpm must be deleted in order to install new rpm. I just want to delete them automatically when new rpm installs. – Jayesh Oct 31 '12 at 9:01

This should generally only be done when a software package is being renamed. If you try to use this to remove other software, you will break someone's system, and administrators will curse you forever...

In this case, use the Obsoletes directive in your spec file.

For instance, in an example package wireshark.spec:

Name: wireshark
Obsoletes: ethereal

(The old name of Wireshark was Ethereal; this made the package update work properly when the software was renamed several years ago.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.