Bug 233249 - Uninstall unneeded dependencies
Summary: Uninstall unneeded dependencies
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 7
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact:
URL:
Whiteboard:
: 221151 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-21 08:23 UTC by Viktor
Modified: 2008-06-17 01:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-06-17 01:16:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Viktor 2007-03-21 08:23:24 UTC
I'm not sure if this should be aimed at rpm or yum, anyway:
I have a suggestion that during installation, rpm should store a refcount for
every package that is merely installed due to dependency. For example, when you
install Abiword, many dependencies are needed. But when you later uninstall
AbiWord, most of those dependencies will remain installed - presumably to no
use, only wasting disk space.
With the refcount, rpm could detect that the dependencies are no longer needed.
And so it would remove them too.
Of course this would only happen if the refcount decreases to zero, so if there
are other applications requiring a certain package, it would not be removed.

Comment 1 Paul Nasrat 2007-03-21 13:47:54 UTC
yum install yum-utils
man package-cleanup

       --leaves
              List leaf nodes in the local RPM database.  Leaf nodes are  RPMs
              that are not relied upon by any other RPM.

You can use the package-cleanup --leaves option to automate removal.

Comment 2 Viktor 2007-03-27 08:32:01 UTC
Thanks, but that program doesn't seem smart enough. It simply lists all packages
that no other package depend on. For example, if I have removed abiword and then
also want its dependencies (as listed below) to be removed, I would need to use
the --all switch to have any of them listed.
And that is too dangerous - it would imply removing also vital applications like
nautilus, evolution and pirut.

So it doesn't do what I requested, i.e. when you install a package, store a
reference for every package that was suggested by yum as a dependency to that
primary package. Thus, if you just run `yum install gtkmathview` there would be
no refcount added to gtkmathview. But if you run `yum install abiword`,
gtkmathview is required as a dependency. Then yum should store a refcount on
gtkmathview linked to abiword. Running `yum remove abiword` later, you could be
asked if to remove `gtkmathview` at the same time (if the refcount on
gtkmathview decreases to zero).
That method would be the most accurate way to decide whether a package is really
needed or not. After you've removed abiword, neither of evolution or gtkmathview
is a dependency. But there is a significant difference between those two
packages, despite that they both appear in the list of `package-cleanup --leaves
--all`.

 abiword                 x86_64     1:2.4.6-1.fc6    extras            6.3 M
Installing for dependencies:
 enchant                 x86_64     1:1.3.0-1.fc6    extras            126 k
 goffice                 x86_64     0.2.1-2.fc6      extras            1.3 M
 gtkmathview             x86_64     0.7.6-5.fc6      extras            872 k
 link-grammar            x86_64     4.2.2-2.fc6      extras            355 k
 mathml-fonts            noarch     1.0-21.fc6       extras            190 k
 ots                     x86_64     0.4.2-10.fc6     extras             52 k

Comment 3 Viktor 2007-04-03 11:30:20 UTC
What I mean is, there should be like a transaction control. So that after you
uninstall a package, the set of installed packages should look exactly as it did
before the install.

Comment 4 Jeff Johnson 2007-04-03 11:43:44 UTC
All installed and removed (if %_repackage_all_erasues 1) packages contain a unique transaction id.

Installed transaction id's are indexed, and the installed packages added by a transaction
can be queried by id using --tid 0x12345678.

Transactions can be removed by using --rollback.

Packages installed by rpm-4.4.4 and later also carry the name of any packages removed
while installing as a "back link":
    $ rpm -q --blink zlib
    zlib-1.2.3-10.fc7.i386.rpm
            <= zlib-1.2.3-7.fc7.i386.rpm

Your scheme of adding a link to parent to dependent package will not work as described because
dependencies are many-to-many, not one-to-one. In other wods, not only abiword may require
gtkmathview, and abiword may require previously installed packages that were installed for
other reasons.

UPSTREAM



Comment 5 Red Hat Bugzilla 2007-08-21 05:32:44 UTC
User pnasrat's account has been closed

Comment 6 Panu Matilainen 2007-08-22 06:30:24 UTC
Reassigning to owner after bugzilla made a mess, sorry about the noise...

Comment 7 Till Maas 2008-01-06 01:38:44 UTC
Afaik this bug is still present in Fedora 7 and beyond.

Comment 8 Panu Matilainen 2008-04-01 11:01:13 UTC
*** Bug 221151 has been marked as a duplicate of this bug. ***

Comment 9 Bug Zapper 2008-05-14 12:11:15 UTC
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. 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 WONTFIX if it remains open with a Fedora 'version' of '7'.

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 prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 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 please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

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. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Bug Zapper 2008-06-17 01:16:46 UTC
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008. 
Fedora 7 is no longer maintained, which means that it will not 
receive any further security or bug fix updates. As a result we 
are closing this bug. 

If you can reproduce this bug against a currently maintained version 
of Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


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