Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: emerge --depclean question
Date: Sun, 31 Dec 2006 15:07:07
Message-Id: en8cua$trs$1@sea.gmane.org
In Reply to: [gentoo-amd64] emerge --depclean question by Mark Knecht
1 "Mark Knecht" <markknecht@×××××.com> posted
2 5bdc1c8b0612301751k5f65c464nf8b9bd99c3b75091@××××××××××.com, excerpted
3 below, on Sat, 30 Dec 2006 17:51:29 -0800:
4
5 > I haven't done this in quite awhile so this evening I started
6 > looking at dependencies a bit. I thought I might take a shot at
7 > cleaning things up old stuff left around from updates over the last
8 > year or so. I ran emerge -p --depclean and was told that there were
9 > about 45 things to remove so I decided I'd try removing a few
10 > one-at-a-time and see how it went. First I sync'ed and did an emerge
11 > -DuN world and made sure the machine was up to date. I then removed
12 > what seemed like a pretty random entry late on the list - imlib - and
13 > then a revdep-rebuild -p to see what it thought. I was then told I
14 > needed to emerge revisions of two new things - gnome-lib and
15 > gtk-pixbuf - neither of which existed according to both emerge and
16 > eix. I then re-emerged imlib, reran revdep-rebuild and now I see the
17 > machine is consistent again.
18
19 gnome-lib and gtk-pixbuf are GNOME-1. Somewhere, you still have something
20 wanting GNOME-1 stuff, which has been removed from the tree as nothing
21 current depends on it.
22
23 You can use equery -d <package> to get a list of merged packages depending
24 on <package>. Try that with gnome-lib and see what comes up. Maybe you
25 don't need it any more and can unmerge it. Or, if it's still in the tree
26 the dependencies must now be fixed, so remerging it should kill the
27 dependencies on gnome-lib. (equery is part of gentoolkit.)
28
29 It's also possible you have "orphaned" libraries around that somehow got
30 left behind after an unmerge. Portage won't know about these so
31 --depclean won't consider them. However, revdep-rebuild does a scan of
32 the actual libraries and applications you have, including orphans and
33 binary-only packages (which remerging won't fix since you just remerge the
34 same binary libraries with the same compiled in dependencies), and thus
35 catches things portage wouldn't.
36
37 > Is this a question that certain ebuilds are not written correctly
38 > and don't somehow call for the right dependencies, or is it something
39 > else?
40
41 It's probably either packages that have changed since you merged them, or
42 orphans, as mentioned above. It could however also be just as you said,
43 dependencies that aren't properly noted in the ebuild. This can be either
44 a missed dependency that needs to be there, or something the package
45 configure script detected on its own, that wasn't part of the ebuild.
46 Gentoo devs try not to have any of those "autodetected" things, because it
47 causes problems exactly like what you are seeing. Instead, they try to
48 specify a hard dependency if the package really needs it, make it
49 conditional on a USE flag if it's optional, or unconditionally tell the
50 config script NOT to use it if Gentoo has a different way of handling it
51 or something, as sometimes happens. However, sometimes upstream changes
52 the dependencies or optional dependencies and the Gentoo devs don't catch
53 the changed config it until someone runs into problems and files a bug.
54
55 > Also, is there any better tool these days for cleaning up stale
56 > packages left around than emerge --depclean?
57
58 Not really... that I know of anyway. There are a few other tools such as
59 dep, from the udept package, but it's worse, not better. (From what I can
60 tell, it checks the dependencies in the ebuilds themselves but not the
61 ones brought in by the eclasses, so it misses some. It's quite a bit
62 faster, but it's also not anywhere near as dependable.)
63
64 Basically, it's a process of using --depclean -p, and getting a list, then
65 using common sense and trial and error to figure out what's safe to remove
66 and what's not. It's not an easy or simple process, which is why there
67 are such big warnings on it. However, it's worthwhile to do once in
68 awhile, both because it helps keep the troubles away, and because stuff
69 that it says needs removed is stuff portage won't be regularly updating,
70 and that can quickly become a security issue if there's a vulnerability in
71 one of those packages.
72
73 One thing that makes things MUCH easier, however, and you may already be
74 doing this, is using FEATURES=buildpkg. If you are, testing unmerges is
75 vastly easier, since if something needs the package, you can simply emerge
76 -k the binary package that was created during the initial merge -- that's
77 what the buildpkg feature DOES.
78
79 If you haven't been using the buildpkg feature, it's also possible to
80 quickpkg the package already on your system before you remove it. Again,
81 if it turns out you actually need it, you don't have to spend all that
82 time recompiling it, all you have to do is emerge -k it, to remerge the
83 binary package you created using quickpkg.
84
85 --
86 Duncan - List replies preferred. No HTML msgs.
87 "Every nonfree program has a lord, a master --
88 and if you use the program, he is your master." Richard Stallman
89
90 --
91 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] Re: emerge --depclean question Mark Knecht <markknecht@×××××.com>
Re: [gentoo-amd64] Re: emerge --depclean question Mark Knecht <markknecht@×××××.com>