Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Howto generate a list of installed packages?
Date: Mon, 28 Dec 2009 10:01:40
Message-Id: 200912281037.00279.alan.mckinnon@gmail.com
In Reply to: [gentoo-user] Howto generate a list of installed packages? by "Alan E. Davis"
1 On Monday 28 December 2009 09:50:31 Alan E. Davis wrote:
2 > Season's Greetings to one and all.
3 >
4 > I would like to be able to generate a script or list of packages of some
5 > kind that would enable me to install Gentoo with an identical profile of
6 > installed packages. Since with Debian/Ubuntu one can run
7 > dpkg --get-selections > file
8 > and
9 > dpkg --set-selections < file
10 > (or some such), one imagines that the Gentoo gurus/magicians are able to do
11 > something similar.
12 >
13 > It takes me months to get a new machine up to speed. In fact, I have just
14 > realized I don't have tcsh installed, something I hardly EVER use, but need
15 > to run a one of a kind script.
16 >
17 > Can anyone make a suggestion? Am I missing something?
18 >
19 > Thanks
20 >
21 > Alan Davis
22 >
23
24
25 You already have such a thing - it's the entire contents of:
26
27 /etc/portage/*
28 /etc/make.conf
29 /etc/make.profile
30 /var/lib/portage/world*
31
32 Copy those files to a destination machine, adapt variable things like CHOST
33 and ACCEPT_KEYWORDS to the new machine, and let portage do it's thing.
34
35 If you simply want a list of packages (sans USE flags etc), "emerge -e world"
36 and parse it through your favourite text pipes (grep, sed, awk, etc) then
37 redirect somewhere
38
39 If you want a list of installed packages with USE flags, "emerge -e world"
40
41 Note that these last two just give you a (mostly) human readable list. They
42 are not much use to portage.
43
44 --
45 alan dot mckinnon at gmail dot com