Bug 136751 - rpm -e succeeds even if /usr is read-only
rpm -e succeeds even if /usr is read-only
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2004-10-22 00:08 EDT by JM Ibanez
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-31 03:41:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description JM Ibanez 2004-10-22 00:08:04 EDT
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 03:41:08 EST
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.