5

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

Anon
  • 151
  • 1
  • 2

2 Answers2

1

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.

dafydd
  • 395
  • 2
  • 3
  • 10
  • 2
    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= ...` will do the installs without an unwanted repositories. – dafydd Oct 26 '12 at 01: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
0

Just To answer how to prevent that (and add to other answer)s, on automated scripts I run dcrpm ( https://github.com/facebookincubator/dcrpm ) before installing software, you install it with pip install dcrpm ... It usually helps with many issues I have

aleivag
  • 121
  • 2