Bug 136751 - rpm -e succeeds even if /usr is read-only
Summary: rpm -e succeeds even if /usr is read-only
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 3
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2004-10-22 04:08 UTC by JM Ibanez
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2004-10-31 08:41:08 UTC

Attachments (Terms of Use)

Description JM Ibanez 2004-10-22 04:08:04 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3)
Gecko/20040913 Firefox/0.10

Description of problem:
Performing an 'rpm -e package' succeeds and removes the RPM database
entry for that package, even if a filesystem that the package files
are on is mounted r/o.

I was cleaning up my installation of Fedora Core, and had previously
set up /usr to be mounted r/o. I did an 'rpm -e Omni-foomatic' to
remove the foomatic package. rpm ran without any complaints, and an
'rpm -q Omni-foomatic' tells me that it was uninstalled. However, the
Omni-foomatic files still remain on disk (as /usr was mounted r/o at
the time of 'rpm -e'). I believe that this can be misleading; if the
files cannot be removed, the operation should fail instead.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Mount /usr as r/o (mount -o remount,ro /usr)
2. Do an 'rpm -e somepackage'
3. Check that the package was removed from the rpm DB by doing 'rpm -q
4. Check that the package files are still there.

Actual Results:  The package files were not removed.

Expected Results:  RPM should complain if a filesystem is mounted r/o
or cannot remove certain package files.

Additional info:

Comment 1 Jeff Johnson 2004-10-31 08:41:08 UTC
This is the "best effort" erasure behavior implemented
in rpm, i.e. ignoring file and directory erasures.

Find the original package to get a list of files
that were not erased:
    rpm -qlp somepackage*.rpm > /tmp/manifest

Examine the list of files.

Mount /usr RW, and do 
    rm -f `cat /tmp/manifest`
to remove the files that were not removed.

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