Red Hat Bugzilla – Bug 79094
rpm -e silently fails, yet still modifies the db
Last modified: 2007-04-18 12:48:52 EDT
On my servers, I typically have most partitions mounted read-only. On one server
here, I uninstalled a bunch of rpms w/o remembering to remount /usr and /boot r/w.
The rpm commands removed packages from the rpm db, yet left the files on the
system (since the filesystems were mounted read-only), but silently failed to
let me know that packages were failing to uninstall
[root@hanuman root]# rpm -e pine
[root@hanuman root]# rpm -e arpwatch ash
[root@hanuman root]# rpm -e hesiod lha
[root@hanuman root]# rpm -e nasm nss_ldap open pax pdksh postgresql
warning: /etc/ldap.conf saved as /etc/ldap.conf.rpmsave
/usr/share/info/dir: Read-only file system
error: %preun(nasm-0.98.34-1) scriptlet failed, exit status 1
[root@hanuman root]# mount
/dev/hda6 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/hda1 on /boot type ext3 (ro)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/hda5 on /tmp type ext3 (rw,noexec,nosuid,nodev)
/dev/hda3 on /usr type ext3 (ro)
[root@hanuman root]# rpm -q pine
package pine is not installed
[root@hanuman root]# /usr/bin/pin<tab>
pine pinegpg-install pinky
At a minimum, I'd expect the rpm command to give me some sort of error when it
fails to remove the files....
rpm does provide error messages, but only if -vv
is supplied. The rationale is that many packages
don't supply sufficient dependency information
to order sufficiently correctly that a directory
is removed iff empty.
Configure %_netsharedpath if you wannt to use
rpm with R/O mounts. It's not at all clear what
should be done in this case, the current behavior,
removing the package header w/o removing the file
is arguably as good as any other behavior.
Hmm, let me reword this. The bigger problem here is that the failed rpm -e
commands silently left the system in a completely inconsistent state. rpm -e
* removed the packages from the databases
* removed some of the files from the system for those packages, but not others
Shouldn't rpm be handling rpm -e as a transaction (ie, remove files and rpm
database entries iff both can be done successfully, and if both can't be done,
exit)? Now that rpm has rollback support, this should be possible to implement....
Re-opening as an RFE -- feel free to close if you don't think that makes sense....
Sure this is needed, but packaging won't support yet,
hence not bothering the user needlessly with an error message.