Red Hat Bugzilla – Bug 966715
Reinstalling a package with rpm -i --excludedocs --replacepkgs does not remove docs.
Last modified: 2015-06-12 07:52:33 EDT
Description of problem:
Reinstalling a package with --excludedocs leaves docs behind on system (even after removing the reinstalled package).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. $ yumdownloader nano
2. # rpm -i nano-2.3.2-2.fc20.x86_64.rpm
3. $ test -e /usr/share/doc/nano-2.3.2/ && echo "Exists"
4. # rpm -i --excludedocs --replacepkgs nano-2.3.2-2.fc20.x86_64.rpm
5. $ test -e /usr/share/doc/nano-2.3.2/ && echo "Exists"
6. # rpm -e nano
7. $ test -e /usr/share/doc/nano-2.3.2/ && echo "Exists"
8. $ rpm -qa nano | wc -l
Docs removed when issuing rpm -i --excludedocs --replacepkg
Same issue can be reproduced with yum:
1. $ grep tsflags /etc/yum.conf
2. # yum install nano
3. $ test -e /usr/share/doc/nano-2.3.2/ && echo "Exists
4. # sed -i 's|# tsflags=nodocs|tsflags=nodocs|' /etc/yum.conf
5. # yum reinstall nano
6. $ test -e /usr/share/doc/nano-2.3.2/ && echo "Exists
7. # yum erase nano
8. $ test -e /usr/share/doc/nano-2.3.2/ && echo "Exists"
9. $ rpm -qa nano | wc -l
That is, setting tsflags=nodocs before reinstalling will result in stray docs.
Also note that the issue only occurs when reinstalling a package (not when removing and then installing again).
the same applies to Fedora 17 and the real interesting question is what happens due a "yum distro-sync" to F18
in the best case installed doc-files of F17 packages are removed and not installed in their F18 version
in the worst case they even get not removed if they are no longer in the package
"tsflags=nodocs" in /etc/yum.conf
it would make virtual infrastructures so much smaller to get rid of docs/manpages and have them only on the admin workstation but not on the whole infrastructure especially in case of full-backups
Okay so its only with 'yum reinstall' or 'rpm ---replacepkgs' where this occurs.
Since that's the case this is "expected behavior" (known bug if you like): --replacepkgs bypasses most normal update-style paths and leaving orphan files behind in various circumstances is a known issue. Changing --replacepkgs to behave more like a normal update (only to the same version) has been on my todo list for some time now, just hasn't gotten done.
Anyway, since its limited to --replacepkgs/reinstall then there are no surprises (to me) involved.
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.
More information and reason for this action is here:
*** Bug 1062956 has been marked as a duplicate of this bug. ***
BTW note that 'rpm -i' must never remove anything (packages nor files), so the exact reproducer command is not going to behave the way described in "expected results", but leaving orphan files behind is obviously a bug. There are roughly two parts to this:
- rpm should refuse an operation which would leave orphan files behind, so -i in such a situation should error out
- rpm needs proper reinstall functionality, technically behaving like an update (but to the already installed version) with separate install and erase transaction elements which allows file removals due to changed docs/langs etc policies etc properly handled.
thanks for feedback!
rm -rf /usr/share/doc/*; rm -rf /usr/share/man/*; yum reinstall filesystem
is by the way a workaround to get "tsflags=nodocs" applied in a existing setup
This use-case is now fixed upstream by adding a new --reinstall command which properly handles changing file policies and such:
[root@localhost rpm]# ./rpm -U nano-2.3.2-4.fc20.x86_64.rpm
[root@localhost rpm]# ls /usr/share/doc/nano/
AUTHORS ChangeLog faq.html nanorc.sample README TODO
BUGS COPYING INSTALL NEWS THANKS
[root@localhost rpm]# ./rpm --reinstall --nodocs nano-2.3.2-4.fc20.x86_64.rpm
[root@localhost rpm]# ls /usr/share/doc/nano/
ls: cannot access /usr/share/doc/nano/: No such file or directory
[root@localhost rpm]# ./rpm -q --state nano|head -5
not installed /usr/share/doc/nano
not installed /usr/share/doc/nano/AUTHORS
Now I just need to figure what to do about --replacepkgs switch, as its "semantics" are rather peculiar...
thank you for feedback
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 20 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Moved the considerations about the future of --replacepkgs to http://rpm.org/ticket/893
Closing as the actual problem is fixed.