Bug 1603

Summary: rpm -e succeeds even if it doesn't remove the files actually
Product: Sisyphus Reporter: imz <vanyaz>
Component: rpmAssignee: placeholder <placeholder>
Status: ASSIGNED --- QA Contact: qa-sisyphus
Severity: major    
Priority: P5 CC: at, glebfm, imz, lav, ldv, mike, n3npq, placeholder, snmon, vt
Version: unstable   
Hardware: all   
OS: Linux   

Description imz 2002-11-21 22:51:05 MSK
I have /usr/ mounted read-only. If I run \'rpm -e some-packge\' 
it succeeds (no warnings or error messages), modifies the db accoedingly, but the files are left in the filesystem. Then there is now way to find the package\'s files, unless there is the binary package file and you reinstall it.

---
# mount /usr -o remount,rw
# apt-get install emacs-el
....
Executing RPM (/bin/rpm -Uvh --fancypercent --oldpackage)...
Preparing...                 ########################################### [100%]
1: emacs-el                  ########################################### [100%]
# rpm -qf /usr/share/emacs/21.2/lisp/simple.el
emacs-el-21.2-alt11
# l /usr/share/emacs/21.2/lisp/simple.el
-rw-r--r--    1 root     root       160008 Mar 13  2002 /usr/share/emacs/21.2/lisp/simple.el
# mount /usr -o remount,ro
# echo a &gt; /usr/a
-bash: /usr/a: Read-only file system
# rpm -e emacs-el
# rpm -q emacs-el
warning: package emacs-el is not installed
# rpm -qf /usr/share/emacs/21.2/lisp/simple.el
warning: file /usr/share/emacs/21.2/lisp/simple.el is not owned by any package
# l /usr/share/emacs/21.2/lisp/simple.el
-rw-r--r--    1 root     root       160008 Mar 13  2002 /usr/share/emacs/21.2/lisp/simple.el

---
rpm-4.0.4-alt11
Comment 1 at@altlinux.org 2003-02-04 15:20:35 MSK
Hmm... but what should rpm do? Assume that it have just deleted some files and some cannot be deleted. If it shows up with error message without db modification, it is nothing better than current RPM behaviour. First, you\'ve got broken RPM package. Second, RPM will never succeed again, because it won\'t be able to \&quot;remove the files actually\&quot; -- the files that\'s been already deleted.
Comment 2 at@altlinux.org 2003-02-04 15:20:35 MSK
Hmm... but what should rpm do? Assume that it have just deleted some files and some cannot be deleted. If it shows up with error message without db modification, it is nothing better than current RPM behaviour. First, you\'ve got broken RPM package. Second, RPM will never succeed again, because it won\'t be able to \&quot;remove the files actually\&quot; -- the files that\'s been already deleted.
Comment 3 imz 2003-02-12 22:50:18 MSK
OK, I assume this. Now, if RPM doesn\'t modify the db, then the situation is similar to that when the admin has removed some files manually by calling `rm\'. In this case, `rpm -V\' helps. Such situation can be well understood by the admin.

At least, some error mesasages would be useful. The silence of the current RPM is not good.


Second. Finally removing a broken packge can be force by some options like: --force, --dbonly etc.

The worst bad thing I see in the described behaviour is loosing information about the package contents.
Comment 4 imz 2003-02-12 22:50:18 MSK
OK, I assume this. Now, if RPM doesn\'t modify the db, then the situation is similar to that when the admin has removed some files manually by calling `rm\'. In this case, `rpm -V\' helps. Such situation can be well understood by the admin.

At least, some error mesasages would be useful. The silence of the current RPM is not good.


Second. Finally removing a broken packge can be force by some options like: --force, --dbonly etc.

The worst bad thing I see in the described behaviour is loosing information about the package contents.
Comment 5 Dmitry V. Levin 2004-01-16 21:20:56 MSK
*** Bug 2084 has been marked as a duplicate of this bug. ***
Comment 6 Jeff Johnson 2012-01-03 03:38:38 MSK
tracked at https://bugs.launchpad.net/rpm/+bug/911042
Comment 7 Vitaly Lipatov 2016-12-12 14:53:40 MSK
Предлагаю автору заявки перетестить на новом rpm :)
Comment 8 Ivan Zakharyaschev 2016-12-12 15:18:43 MSK
(In reply to comment #7)
> Предлагаю автору заявки перетестить на новом rpm :)

Now, there are warnings, but the pkg is still removed from the BD:

[root@prodesk0 ~]# rpm -q syslinux-extlinux -l
/boot/extlinux
/boot/extlinux/cat.c32
/boot/extlinux/chain.c32
/boot/extlinux/cmd.c32
/boot/extlinux/config.c32
/boot/extlinux/cpuid.c32
/boot/extlinux/cpuidtest.c32
/boot/extlinux/disk.c32
/boot/extlinux/dmitest.c32
/boot/extlinux/elf.c32
/boot/extlinux/ethersel.c32
/boot/extlinux/gfxboot.c32
/boot/extlinux/gpxecmd.c32
/boot/extlinux/hdt.c32
/boot/extlinux/host.c32
/boot/extlinux/ifcpu.c32
/boot/extlinux/ifcpu64.c32
/boot/extlinux/ifplop.c32
/boot/extlinux/int18.com
/boot/extlinux/kbdmap.c32
/boot/extlinux/linux.c32
/boot/extlinux/ls.c32
/boot/extlinux/lua.c32
/boot/extlinux/mboot.c32
/boot/extlinux/memdisk
/boot/extlinux/memdump.com
/boot/extlinux/meminfo.c32
/boot/extlinux/menu.c32
/boot/extlinux/pcitest.c32
/boot/extlinux/pmload.c32
/boot/extlinux/poweroff.com
/boot/extlinux/pwd.c32
/boot/extlinux/pxechain.com
/boot/extlinux/reboot.c32
/boot/extlinux/rosh.c32
/boot/extlinux/sanboot.c32
/boot/extlinux/sdi.c32
/boot/extlinux/sysdump.c32
/boot/extlinux/ver.com
/boot/extlinux/vesainfo.c32
/boot/extlinux/vesamenu.c32
/boot/extlinux/vpdtest.c32
/boot/extlinux/whichsys.c32
/usr/bin/extlinux
[root@prodesk0 ~]# mount -o remount,ro /boot
[root@prodesk0 ~]# rpm -e syslinux-extlinux
warning: file /boot/extlinux/whichsys.c32: remove failed: Read-only file system
warning: file /boot/extlinux/vpdtest.c32: remove failed: Read-only file system
warning: file /boot/extlinux/vesamenu.c32: remove failed: Read-only file system
warning: file /boot/extlinux/vesainfo.c32: remove failed: Read-only file system
warning: file /boot/extlinux/ver.com: remove failed: Read-only file system
warning: file /boot/extlinux/sysdump.c32: remove failed: Read-only file system
warning: file /boot/extlinux/sdi.c32: remove failed: Read-only file system
warning: file /boot/extlinux/sanboot.c32: remove failed: Read-only file system
warning: file /boot/extlinux/rosh.c32: remove failed: Read-only file system
warning: file /boot/extlinux/reboot.c32: remove failed: Read-only file system
warning: file /boot/extlinux/pxechain.com: remove failed: Read-only file system
warning: file /boot/extlinux/pwd.c32: remove failed: Read-only file system
warning: file /boot/extlinux/poweroff.com: remove failed: Read-only file system
warning: file /boot/extlinux/pmload.c32: remove failed: Read-only file system
warning: file /boot/extlinux/pcitest.c32: remove failed: Read-only file system
warning: file /boot/extlinux/menu.c32: remove failed: Read-only file system
warning: file /boot/extlinux/meminfo.c32: remove failed: Read-only file system
warning: file /boot/extlinux/memdump.com: remove failed: Read-only file system
warning: file /boot/extlinux/memdisk: remove failed: Read-only file system
warning: file /boot/extlinux/mboot.c32: remove failed: Read-only file system
warning: file /boot/extlinux/lua.c32: remove failed: Read-only file system
warning: file /boot/extlinux/ls.c32: remove failed: Read-only file system
warning: file /boot/extlinux/linux.c32: remove failed: Read-only file system
warning: file /boot/extlinux/kbdmap.c32: remove failed: Read-only file system
warning: file /boot/extlinux/int18.com: remove failed: Read-only file system
warning: file /boot/extlinux/ifplop.c32: remove failed: Read-only file system
warning: file /boot/extlinux/ifcpu64.c32: remove failed: Read-only file system
warning: file /boot/extlinux/ifcpu.c32: remove failed: Read-only file system
warning: file /boot/extlinux/host.c32: remove failed: Read-only file system
warning: file /boot/extlinux/hdt.c32: remove failed: Read-only file system
warning: file /boot/extlinux/gpxecmd.c32: remove failed: Read-only file system
warning: file /boot/extlinux/gfxboot.c32: remove failed: Read-only file system
warning: file /boot/extlinux/ethersel.c32: remove failed: Read-only file system
warning: file /boot/extlinux/elf.c32: remove failed: Read-only file system
warning: file /boot/extlinux/dmitest.c32: remove failed: Read-only file system
warning: file /boot/extlinux/disk.c32: remove failed: Read-only file system
warning: file /boot/extlinux/cpuidtest.c32: remove failed: Read-only file system
warning: file /boot/extlinux/cpuid.c32: remove failed: Read-only file system
warning: file /boot/extlinux/config.c32: remove failed: Read-only file system
warning: file /boot/extlinux/cmd.c32: remove failed: Read-only file system
warning: file /boot/extlinux/chain.c32: remove failed: Read-only file system
warning: file /boot/extlinux/cat.c32: remove failed: Read-only file system
warning: directory /boot/extlinux: remove failed: Read-only file system
[root@prodesk0 ~]# echo $?
0
[root@prodesk0 ~]# rpm -q syslinux-extlinux -l
package syslinux-extlinux is not installed
[root@prodesk0 ~]# l /boot/extlinux/rosh.c32
-rw-r--r-- 1 root root 21128 Dec  3  2015 /boot/extlinux/rosh.c32
[root@prodesk0 ~]# rpm -q rpm
rpm-4.13.0-alt3.x86_64
[root@prodesk0 ~]#