Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are automating some deploy scripts which uninstall/install RPMs. I've seen on more than one of our hosts that rpm -qa returns something like:

# rpm -qa | grep tcl
tcl-8.5.7-6.el6.x86_64
tcl-8.5.7-6.el6.x86_64
tcl-8.5.7-6.el6.x86_64
tcl-8.5.7-6.el6.x86_64
tcl-8.5.7-6.el6.x86_64
tcl-8.5.7-6.el6.x86_64

How does this happen using rpm -e and rpm -i? And is there a way to prevent this? If I run rpm -e in this case, I get

# rpm -e tcl-8.5.7-6.el6
error: "tcl-8.5.7-6.el6" specifies multiple packages:
  tcl-8.5.7-6.el6.x86_64
  tcl-8.5.7-6.el6.x86_64
  tcl-8.5.7-6.el6.x86_64
  tcl-8.5.7-6.el6.x86_64
  tcl-8.5.7-6.el6.x86_64
  tcl-8.5.7-6.el6.x86_64

So I had to use the -vv --allmatches --nodeps --noscripts --notriggers switches

share|improve this question
    
What are your install scripts really doing? –  Michael Hampton Oct 24 '12 at 19:49
    
When it comes to RPMs, only rpm -i and rpm -e. After installation and such they might drop config files and start some services, but that's it. –  Anon Oct 24 '12 at 20:01
    
You sure you aren't using any other switches? –  Michael Hampton Oct 24 '12 at 20:02
    
we do rpm -i ... >/dev/null 2>&1 and same for rpm -e. No other switches. Looking @ the script now –  Anon Oct 24 '12 at 21:09
1  
Why the /dev/null redirection? Don't you want to know if there are problems? –  itsbruce Oct 24 '12 at 22:06
show 1 more comment

1 Answer

Anon,

Are you in a position to try rpm --rebuilddb, if you haven't already?

http://www.rpm.org/max-rpm/rpm.8.html

Alternately, are you in a position to use yum install, instead of rpm? Yum will usually take better care of your database.

share|improve this answer
    
Yea I have fixed it w/ the rebuilddb and such. I'm just trying to understand what I'm doing might cause problems. Yum might be a good option but I just need to make sure it doesn't pull anything down from the net - only the rpms that I want to install –  Anon Oct 25 '12 at 19:56
    
yum repolist will show you the repositories yum is aware of. Then, yum --disablerepo=<name> ... will do the installs without an unwanted repositories. –  dafydd Oct 26 '12 at 1:59
    
Sadly we just switched to yum and ran the install/uninstall a few times - we ended up with Rpmdb checksum is invalid: dCDPT(pkg checksums) ... [ERROR] –  Anon Oct 30 '12 at 13:23
add comment

Your Answer

 
discard

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.