Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How to find the unused packages?

  1. #1
    Join Date
    Jun 2008
    Location
    relative
    Posts
    1,172

    Default How to find the unused packages?

    How to find the packages what's are installed as dependencies while I'm installed an other program.
    Example: I'm installed a java game and the package manager installed about 6-7 more programs for dependencies. I don't like this game, so I'm uninstalled it - but how to remove the other packages what's are also installed just for this game and doesn't needed by any other application?
    Thanks.
    http://mydailyhash.wordpress.com/
    http://yami.googlecode.com/

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,378
    Blog Entries
    1

    Default Re: How to find the unused packages?

    This is not always a strait forward process.

    You can do

    rpm -qa --last

    which will list all packages installed by date. From that info you can probably determine which additional packages were added along with a particular application you installed.

    You can also crosscheck with

    rpm -qR name_of_application_package

    to see which dependencies 'name_of_application_package' has.

  3. #3
    Join Date
    Jun 2008
    Location
    relative
    Posts
    1,172

    Default Re: How to find the unused packages?

    Okay. Thanks for the suggestion!
    So, just to clear out - there is no option to determinate what is "junk"(unused) from your packages.
    http://mydailyhash.wordpress.com/
    http://yami.googlecode.com/

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,378
    Blog Entries
    1

    Default Re: How to find the unused packages?

    Not really. Care needs to be exercised when installing additional (potentially useless) application packages so as to avoid package bloat.

  5. #5
    Chris Maaskant NNTP User

    Default Re: How to find the unused packages?

    Op Sun, 18 Jan 2009 10:16:01 +0000, schreef ram88:

    > Okay. Thanks for the suggestion!
    > So, just to clear out - there is no option to determinate what is
    > "junk"(unused) from your packages.


    I believe this is something worked for the next version for zypper.
    Not sure though, maybe it was just a request.

    --
    Chris Maaskant

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,136

    Default Re: How to find the unused packages?

    Quote Originally Posted by ram88 View Post
    Okay. Thanks for the suggestion!
    So, just to clear out - there is no option to determinate what is "junk"(unused) from your packages.
    You should have written them down.
    Henk van Velden

  7. #7

    Default Re: How to find the unused packages?

    Uhmm....if you think at sudo apt-get autoremove from Ubuntu, you're out of luck. Zypper doesn't have similar feature

  8. #8

    Default Re: How to find the unused packages?

    The dependencies of a package are shown by the Software Package Manager, but unfortunately there's not a simple GUI way of discovering which packages satisfied the dependencies.

    Example, looking at Wesnoth :

    libc
    libz
    ...
    libSDL
    wesnoth-data-set
    wesnoth-data-base
    wesnoth-data-full


    Unfortunately it won't let my copy text and paste it.
    rpm will tell you the package name that a file belongs in :

    rob@fir:~> rpm -qf /usr/lib/libXft.so
    xorg-x11-devel-7.2-103.4
    rob@fir:~> rpm -qf /usr/lib/libXft.so.2
    xorg-x11-libs-7.2-103.4

    The ordering appears to be a big clue, without knowing what package bloated the system, it's hard to know which dependencies are culprits.

    There's probably a way of scripting, to find packages which aren't required :

    rob@fir:~> rpm -q --whatprovides libXft.so.2
    xorg-x11-libs-7.2-103.4
    rob@fir:~> rpm -q --whatrequires libXft.so.2
    v4l-conf-3.95-98
    yast2-control-center-qt-2.15.4-12
    sax2-tools-8.1-258
    pango-1.18.2-4
    kpowersave-0.7.3-5
    compiz-kde-0.5.4-27
    vte-0.16.9-4
    grip-3.2.0-171
    fvwm2-2.5.23-1.1
    xorg-x11-7.2-135.4
    kmplayer-0.10.0c-0.pm.2
    avahi-qt3-0.6.20-40
    kde4-amarok-4.0.svn765209-1.7
    koffice-1.6.3-81.1
    koffice-illustration-1.6.3-81.1
    dbus-1-qt3-0.62-110.1
    kvirc-3.2.6-85
    libkde4-4.0.4-33.18
    libkdegames4-4.0.4-11.49
    libkonq4-4.0.4-22.42
    kdelibs4-doc-4.0.4-33.18
    qt3-3.3.8b-88.2
    arts-1.5.10-14.3
    kdelibs3-3.5.10-31.1
    kdegraphics3-pdf-3.5.10-2.25
    kdebase3-runtime-3.5.10-29.1
    kdenetwork3-InstantMessenger-3.5.10-15.2
    libkcompactdisc4-4.0.4-11.71
    libakonadi4-4.1.0-2.1
    libkdepimlibs4-4.1.0-2.1
    openbox-3.4.7.2-2.3
    lxterminal-0.1.3-6.1
    ktorrent-2.2.7-0.pm.3
    mozilla-xulrunner190-1.9.0.5-3.1
    xterm-229-17.2

    So looking at the dependencies of the package, rpm -q --whatrequires <dependency> not finding a dependant package, suggests you can remove it safely. rpm -q --requires <package> should give you a list of dependencies to check with --whatrequires.

  9. #9

    Default Re: How to find the unused packages?

    Quote Originally Posted by robopensuse View Post
    There's probably a way of scripting, to find packages which aren't required
    Code:
    #!/bin/bash
    
    export LC_ALL=C
    
    for PACKAGE in $(rpm -qa); do
      NEEDED=false
      for PROVIDE in $(rpm -q --provides "$PACKAGE" | awk '{print $1}'); do
        if [ $(rpm -q --whatrequires "$PROVIDE" | fgrep -v 'no package requires' | wc -l) -gt 0 ]; then
          NEEDED=true
        fi
      done
      if [ "$NEEDED" = false ]; then
        echo "$PACKAGE"
      fi
    done
    Execute it and the output will make clear why isn't so simple.
    First, there are not just hard dependencies ("requires"), there are also soft deps ("recommends", "suggests", "supplements" and "enhances"). But even if you also look at them... no package requires "kdebluetooth4", does that means that I can remove it? NOOOO!! There are packages that are installed just because the user wants them, not because other packages need them. Start to remove every package that isn't needed by another one recurrently and you will end removing *all* the packages.

    To implement the "unneeded packages" feature one needs to know why a package was installed. But even this way can fail: suppose there exists a package 'X' that needs kdebluetooth4. You install X and so kdebluetooth4 is automatically installed. You want kdebluetooth4 by itself, but since has been automatically installed when you remove 'X' kdebluetooth4 will be also removed.

    What apt-get/aptitude/etc. do is mark every package like automatically or manually installed. That's the same that openSUSE will do... but, again, even if it's better than the script it's still far from perfect.

  10. #10
    Join Date
    Jun 2008
    Location
    relative
    Posts
    1,172

    Default Re: How to find the unused packages?

    Thanks for everyone! Good reason to start experimenting with package management.
    http://mydailyhash.wordpress.com/
    http://yami.googlecode.com/

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •