I had a problem with nfs mount.
rpm erase was hanging.
I couldn't cancel (Ctrl-C) the rpm process.
There was no reason why rpm should have been accessing this mount point.
df
command was also hanging.
Compare mount
and df
output.
The mount that df got stuck on was a problem. Two mounts were a problem for me.
umount /badmount
didn't work "umount.nfs: /badmount: device is busy".
umount --force -vvv /badmounts
got rid of the bad mount (remote machine was down). Then kill <my rpm process>
. THen rm /var/lib/rpm/__db* && rpm --rebuilddb
. From then on rpm working again.
rpm -vvv
was useful and led me to think that mounts were a problem.
It was hanging after printing "mounted filesystems:"
$ rpm -e --noscripts -vvv PACKAGE
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name rdonly mode=0x0
D: read h# 1489 Header sanity check: OK
D: added key gpg-pubkey-57bbccba-4a6f97af to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: read h# 912 Header SHA1 digest: OK (9fda42f8af7a801b81d14291987d1052d2c17c53)
D: ========== --- OMN-Traffic-Control-vx.xx.xx-1.FC9 i686/linux 0x0
D: opening db index /var/lib/rpm/Requirename rdonly mode=0x0
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)
D: 0 0 0 0 1 0 -OMN-Traffic-Control-vx.xx.xx-1.FC9.i686
D: erasing packages
D: closed db index /var/lib/rpm/Requirename
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv
D: opening db index /var/lib/rpm/Packages create mode=0x42
D: mounted filesystems:
D: i dev bsize bavail iavail mount point
An ltrace was vaguely interesting but didn't give any clue to problem.
$ ltrace rpm -e PACKAGE
__libc_start_main(0x8049680, 3, 0xffab6264, 0x804ae90, 0x804ae80 <unfinished ...>
mtrace() = <void>
strrchr("rpm", '/') = NULL
setlocale(6, "") = "en_US.UTF-8"
bindtextdomain("rpm", "/usr/share/locale") = "/usr/share/locale"
textdomain("rpm") = "rpm"
rpmlogSetMask(63, 0x99a390, 0xf63d4e2e, 0xb3ff08, 28) = 63
poptGetContext(0x804af4c, 3, 0xffab6264, 0x804ce40, 0) = 0x98528d8
rpmConfigDir(0x804af4c, 3, 0xffab6264, 0x804ce40, 0) = 0xce2432
rpmGenPath(0xce2432, 0x804af75, 0, 0x804ce40, 0) = 0x9852b40
poptReadConfigFile(0x98528d8, 0x9852b40, 0, 0x804ce40, 0) = 0
free(0x9852b40) = <void>
poptReadDefaultConfig(0x98528d8, 1, 0, 0x804ce40, 0) = 0
rpmConfigDir(0x98528d8, 1, 0, 0x804ce40, 0) = 0xce2432
poptSetExecPath(0x98528d8, 0xce2432, 1, 0x804ce40, 0) = 1
poptGetNextOpt(0x98528d8, 0xce2432, 1, 0x804ce40, 0) = -1
rpmcliConfigured(0x98528d8, 0xce2432, 1, 0x804ce40, 0) = 0
urlIsURL(0xd487af, 0xce2432, 1, 0x804ce40, 0) = 0
rpmLookupSignatureType(1, 0xce2432, 1, 0x804ce40, 0) = 0
rpmtsCreate(1, 0xce2432, 1, 0x804ce40, 0) = 0x98729c8
rpmtsSetRootDir(0x98729c8, 0xd487af, 1, 0x804ce40, 0) = 0
poptPeekArg(0x98528d8, 0xd487af, 1, 0x804ce40, 0) = 0xffab7622
poptGetArgs(0x98528d8, 0xd487af, 1, 0x804ce40, 0) = 0x9852a70
rpmErase(0x98729c8, 0xd5c440, 0x9852a70, 0x804ce40, 0