title: Can I remove an RPM from within .spec scripts sections?
body: <p>I'm building a new version of an existing .spec/rpm and I want to remove a dependency that was required by that is not anymore (previous .spec had "Requires:   rpm-xyz).</p>
  
  <p>So on top of removing the Requires: rpm-xyz, I added the following in the "%post" section of the .spec file:</p>
  
  <p>rpm -e rpm-xyz.</p>
  
  <p>When I install the generated rpm with yum, after downloading it and asked me the confirmation to processed, I get this line and it stuck there forever:</p>
  
  <p>warning: waiting for transaction lock on /var/lib/rpm/__db.000</p>
  
  <p>So it looks like a deadlock to me (yum calls rpm, then calls rpm from within). So I have __db.oox file in the /var/lib/rpm  and I need to rebuild the rom database to removed them.</p>
  
  <p>So the question is: Am I allow to call the rpm command from within a spec file? I've read on the Obsolete tags, but it does not remove rpm. What would be the best way to remove the rpm?</p>
  
  <p>Thanks,</p>
  
  <p>-Martin</p>
  
  <p>P.S. Extra info: Yes, I need to remove old dependencies and no, no others rpm depend on it.</p>