Gentoo Archives: gentoo-user

From: "Jesús Guerrero" <i92guboj@×××××.es>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
Date: Thu, 22 Oct 2009 13:58:57
Message-Id: 29ea6c787cd0c0abdcfcc661fbcda029@localhost
In Reply to: Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree by Alan McKinnon
1 On Thu, 22 Oct 2009 14:09:31 +0200, Alan McKinnon
2 <alan.mckinnon@×××××.com>
3 wrote:
4 > On Thursday 22 October 2009 15:42:41 Johannes Kimmel wrote:
5 >> Helmut Jarausch wrote:
6 >> > Hi,
7 >> >
8 >> > is there an easy way to unmerge all packages which are no longer in
9 >> > the current portage tree.
10 >> > (Those make problems on update world)
11 >> >
12 >> > Many thanks for a hint,
13 >> > Helmut.
14 >>
15 >> if packages are not in the portage tree, they should not be pulled in
16 >> anymore. therefore "emerge --depclean" could help.
17 >
18 > depclean only removes packages that it knows for a fact are no longer
19 > needed.
20 > This means
21 >
22 > - not in world
23 > - not linked to by anything
24 > - not depended on by anything
25 >
26 > "not in the tree" is not part of that list. If you have a package in
27 world
28 > that is not in the tree anymore, depclean will leave it as is. It will
29 > remove
30 > ancient mere deps that are somehow still lying around though
31
32 Yep, if the package is in world, delclean will not help.
33
34 You could always do it the bash way. I have no idea if there's any tool
35 out there that will make this easier, but it's simple enough to script it,
36 something like this should work:
37
38 qlist -I --nocolor | while read pkg; do
39 if [ ! -d "/var/portage/$pkg" ]; then
40 echo "$pkg is not in portage"
41 fi
42 done
43
44 This will not catch overlays, but it could be easily extended to do so,
45 it's just a generic (and untested) example. It should work I guess. It just
46 dumps the list of installed packages, then tries to find a dir with the
47 same name under your portage directory and if it doesn't exist then the
48 package name is printed.
49
50 --
51 Jesús Guerrero

Replies

Subject Author
Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree Alan McKinnon <alan.mckinnon@×××××.com>