Red Hat Bugzilla – Bug 78766
rpm -e on read-only partition removes package from database (but not from filesystem)
Last modified: 2008-05-01 11:38:04 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021126
Description of problem:
When I try to remove a package that has some (or all) files on a partition that
is mounted read-only, rpm doesn't complain but simply ignores these files. The
package is then removed from the database. The only way to fully remove the
package (except from deleting files by hand) is to (obviously) remount the
partition read-write, reinstall the package (to get it into the database) and
remove it again.
Version-Release number of selected component (if applicable): 4.0.4-7x
Steps to Reproduce:
1. Install a package that has some files on a partition you can mount read-only.
Say we use ltp-11.07.02-0.i386.rpm (the linux test project). It installs in
/usr/local/ltp/... and /usr/share/..., so these would have to be on a partition
that can be mounted read-only. Let's assume /usr is a separate partition.
2. mount /usr -o ro,remount
3. rpm -e ltp
4. ls /usr/local
5. rpm -q ltp
After step 3.: after a second of two, the prompt returns. No output.
After step 4.: all the files are there still (of course)
After step 5.: it says "package ltp is not installed"
After step 3.: it should have said "Hey, I can't remove these files!"
After step 4.: (should still show all files)
After step 5.: it should have said "ltp-11.07.02-0"
This bug seems to be related to bug #74438.
Other than through %_netsharedpath, rpm has no
support for RO mounts, ditto chattr files.
No matter what, rpm cannot remove readonly files.
Maybe I wasn't quite clear -- I agree that rpm can't and shouldn't remove the
files, but it should complain that something is wrong (as suggested in expected
results, step 3). And I think it should let the package remain in the rpm
database, because that makes it difficult to remove the files after remounting
the partition read-write (as suggested in expected results, step 5).