Bug 78766 - rpm -e on read-only partition removes package from database (but not from filesystem)
Summary: rpm -e on read-only partition removes package from database (but not from fil...
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.1
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2002-11-29 13:48 UTC by Need Real Name
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2002-11-29 13:48:44 UTC

Attachments (Terms of Use)

Description Need Real Name 2002-11-29 13:48:38 UTC
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

How reproducible:

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

Actual Results:  
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"

Expected Results:  
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"

Additional Information:
This bug seems to be related to bug #74438.

Comment 1 Jeff Johnson 2002-11-29 14:45:07 UTC
Other than through %_netsharedpath, rpm has no
support for RO mounts, ditto chattr files.

No matter what, rpm cannot remove readonly files.

Comment 2 Need Real Name 2002-11-29 16:37:43 UTC
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).

Note You need to log in before you can comment on or make changes to this bug.