Beruflich Dokumente
Kultur Dokumente
http://unix.stackexchange.com/questions/40179/...
sign up
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like
operating systems.. It's 100% free, no registration required.
log in
tour
/ yum
/ rpm
22
214
462
Have you looked at the yum manpage: linux.die.net/man/8/yum ? Linuxios Jun 6 '12 at 19:22
3 Answers
It's not easy. How do you differentiate between "a file that was required by something I have
since removed" from "a file that is not required by anything else that I really want"?
You can use the package-cleanup command from the yum-utils package to list "leaf nodes"
in your package dependency graph. These are packages that can be removed without
affecting anything else:
$ package-cleanup --leaves
This will produce a list of "libraries" on which nothing else depends. In most cases you can
safely remove these packages. If you add --all to the command line:
$ package-cleanup --leaves --all
You'll get packages that aren't considered libraries, also, but this list is going to be so long that
it probably won't be useful.
answered Jun 6 '12 at 19:32
larsks
2,193
10
APT (the Debian equivalent of Yum) has a notion of automatically installed package. If a package wasn't explicitly
requested but only pulled in as a dependency, it'll be automatically removed (with a confirmation prompt) if the
packages that depend on it are all removed. Without an indication of this type, it is indeed not easy. Gilles Jun 6
'12 at 23:53
yum install
, say
pdftk
Installed:
pdftk.x86_64 0:1.44-10.fc18
Dependency Installed:
bouncycastle.noarch 0:1.46-6.fc18
itext-core.noarch 0:2.1.7-14.fc18
libgcj.x86_64 0:4.7.2-8.fc18
bouncycastle-mail.noarch 0:1.46-6.fc18
java-1.5.0-gcj.x86_64 0:1.5.0.0-40.fc18
sinjdoc.x86_64 0:0.5-13.fc18
bouncycastle-tsp.noarch 0:1.46-5.fc18
java_cup.noarch 1:0.11a-10.fc18
1 of 2
01/04/2014 12:48 AM
http://unix.stackexchange.com/questions/40179/...
itext.x86_64 0:2.1.7-14.fc18
javamail.noarch 0:1.4.3-12.fc18
Complete!
yum remove pdftk
will remove only that package and not all the dependencies.
But you can look at all the 'transactions' (install, remove etc.):
$ sudo yum history list pdftk
ID
| Command line
| Action(s)
| Altered
11
@fedora
Dep-Install bouncycastle-mail-1.46-6.fc18.noarch
@fedora
Dep-Install bouncycastle-tsp-1.46-5.fc18.noarch
@fedora
Dep-Install itext-2.1.7-14.fc18.x86_64
@fedora
Dep-Install itext-core-2.1.7-14.fc18.noarch
@fedora
@fedora
Dep-Install javamail-1.4.3-12.fc18.noarch
@fedora
Dep-Install libgcj-4.7.2-8.fc18.x86_64
@fedora
Install
@fedora
pdftk-1.44-10.fc18.x86_64
Dep-Install sinjdoc-0.5-13.fc18.x86_64
@fedora
...
Complete!
Starting from Fedora 18, you can simply use this command
yum autoremove
or
yum remove --setopt=clean_requirements_on_remove=1
Which will remove unneeded dependencies from that installed package. autoremove is very
much an aliais of "remove --setopt=clean_requirements_on_remove=1" but for some reasons,
is still undocumented.
answered Jul 17 '13 at 20:07
Finalzone
21
2 of 2
01/04/2014 12:48 AM