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.
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.
ram88;1929390 Wrote:
> 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. rotfl!
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.
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.
robopensuse;1929436 Wrote:
> 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.