/[gentoo]/xml/htdocs/doc/en/gentoolkit.xml
Gentoo

Diff of /xml/htdocs/doc/en/gentoolkit.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.13 Revision 1.29
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoolkit.xml,v 1.13 2004/08/31 18:57:03 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoolkit.xml,v 1.29 2007/06/26 04:02:53 nightmorph Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/doc/en/gentoolkit.xml"> 5<guide link="/doc/en/gentoolkit.xml">
6<title>Gentoolkit</title> 6<title>Gentoolkit</title>
7 7
13</author> 13</author>
14<author title="Editor"> 14<author title="Editor">
15 <mail link="erwin@gentoo.org">Erwin</mail> 15 <mail link="erwin@gentoo.org">Erwin</mail>
16</author> 16</author>
17<author title="Editor"> 17<author title="Editor">
18 <mail link="fox2mike@gmail.com">Shyam Mani</mail> 18 <mail link="fox2mike@gentoo.org">Shyam Mani</mail>
19</author> 19</author>
20<author title="Editor"> 20<author title="Editor">
21 <mail link="neysx@gentoo.org">Xavier Neys</mail> 21 <mail link="neysx@gentoo.org">Xavier Neys</mail>
22</author> 22</author>
23 23<author title="Editor">
24<!-- Licensed under GFDL --> 24 <mail link="karltk@gentoo.org">Karl Trygve</mail>
25</author>
26<author title="Editor">
27 <mail link="yoswink@gentoo.org">José Luis Rivero</mail>
28</author>
29<author title="Editor">
30 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
31</author>
25 32
26<abstract> 33<abstract>
27Gentoolkit is a suite of tools to ease the administration of a Gentoo system. 34Gentoolkit is a suite of tools to ease the administration of a Gentoo system.
28This document covers the basics of some of the tools present in Gentoolkit. 35This document covers the basics of some of the tools present in Gentoolkit.
29</abstract> 36</abstract>
30 37
38<!-- Licensed under GFDL -->
39
31<version>1.4</version> 40<version>1.11</version>
32<date>August 25, 2004</date> 41<date>2007-02-20</date>
33 42
34<chapter> 43<chapter>
35<title>Introduction</title> 44<title>Introduction</title>
36<section> 45<section>
37<title>What is Gentoolkit?</title> 46<title>What is Gentoolkit?</title>
48 57
49<note> 58<note>
50As of now, there are two versions of gentoolkit: <c>app-portage/gentoolkit</c> 59As of now, there are two versions of gentoolkit: <c>app-portage/gentoolkit</c>
51and <c>app-portage/gentoolkit-dev</c>. While the former contains administration 60and <c>app-portage/gentoolkit-dev</c>. While the former contains administration
52scripts, the latter contains scripts specific to help development on Gentoo. 61scripts, the latter contains scripts specific to help development on Gentoo.
62If you are a developer, you can have your scripts included into
63<c>gentoolkit-dev</c> by contacting the Gentoolkit maintainer. This document
53This document discusses gentoolkit only. 64discusses gentoolkit only.
54</note> 65</note>
55 66
56<p> 67<p>
57Gentoolkit contains a whole bunch of useful tools to help manage your packages 68Gentoolkit contains a whole bunch of useful tools to help manage your packages
58and keep track of what is going on in your system. Most users̶ --&nbsp;particularly 69and keep track of what is going on in your system. Most users --&nbsp;particularly
59those who update systems often&nbsp;-- will benefit from having gentoolkit 70those who update systems often&nbsp;-- will benefit from having gentoolkit
60installed. 71installed.
61</p> 72</p>
62 73
63</body> 74</body>
86<title>Finding Documentation</title> 97<title>Finding Documentation</title>
87<body> 98<body>
88 99
89<p> 100<p>
90Any documentation that a program might have (other than man pages) is stored in 101Any documentation that a program might have (other than man pages) is stored in
91<path>/usr/doc/gentoolkit-[version]/[program-name]/</path>. 102<path>/usr/share/doc/gentoolkit-[version]/[program-name]/</path>.
92</p>
93
94</body>
95</section>
96</chapter>
97
98<chapter>
99<title>Querying Package Data with qpkg</title>
100<section>
101<title>Introduction</title>
102<body>
103
104<p>
105<c>qpkg</c> is a flexible tool for determining information about installed
106ebuilds. It can provide information about what files belong to which ebuilds,
107whether multiple versions of the same package are installed and what a
108particular ebuild does. It can also be used to query some information about
109ebuilds that have not been installed.
110</p>
111
112<p>
113Calling <c>qpkg</c> with no arguments prints a list of all ebuilds with
114asterisks (*) next to the packages that are installed on the system.
115</p>
116
117<note>
118By default, <c>qpkg</c> prints output in color. To turn this off on the command
119line, use the <c>--no-color</c> or <c>-nc</c> flag.
120</note>
121
122</body>
123</section>
124<section>
125<title>Querying Package Information</title>
126<body>
127
128<p>
129One of the most common uses for <c>qpkg</c> is determining what a given package
130is. For instance, while looking through <path>net-misc</path>, I saw a package
131called <path>neon</path>. Having no idea what it was, I ran qpkg.
132</p>
133
134<pre caption="Package Information">
135# <i>qpkg -i net-misc/neon</i>
136net-misc/neon-0.24.4
137 HTTP and WebDAV client library [ http://www.webdav.org/neon ]
138net-misc/neon-0.23.8
139 HTTP and WebDAV client library [ http://www.webdav.org/neon ]
140net-misc/neon-0.24.6
141 HTTP and WebDAV client library [ http://www.webdav.org/neon/ ]
142net-misc/neon-0.24.5
143 HTTP and WebDAV client library [ http://www.webdav.org/neon ]
144net-misc/neon-0.24.0
145 HTTP and WebDAV client library [ http://www.webdav.org/neon ]
146net-misc/neon-0.21.3
147 HTTP and WebDAV client library [ http://www.webdav.org/neon ]
148net-misc/neon-0.23.9
149 HTTP and WebDAV client library [ http://www.webdav.org/neon ]
150net-misc/neon-0.24.7
151 HTTP and WebDAV client library [ http://www.webdav.org/neon/ ]
152net-misc/neon-0.24.2
153 HTTP and WebDAV client library [ http://www.webdav.org/neon ]
154</pre>
155
156<p>
157<c>qpkg</c> read through the ebuild files for the nine
158<path>net-misc/neon</path> ebuilds and printed out the information stored in
159DESCRIPTION and HOMEPAGE.
160</p>
161
162</body>
163</section>
164<section>
165<title>Listing Files Belonging to an Ebuild</title>
166<body>
167
168<p>
169<c>qpkg</c> can also list the files that belong to an installed ebuild. I
170know that gentoolkit installed several tools, but I don't know what they
171all are. To find out, I can do a <c>qpkg -l</c>.
172</p>
173
174<pre caption="Package File list using qpkg">
175# <i>qpkg -l app-portage/gentoolkit</i>
176app-portage/gentoolkit-0.2.0_pre8 *
177CONTENTS:
178/usr
179/usr/bin
180/usr/bin/euse
181/usr/bin/qpkg
182/usr/bin/etcat
183/usr/bin/revdep-rebuild
184/usr/bin/glsa-check
185/usr/bin/dep-clean
186/usr/bin/equery
187/usr/bin/ewhich
188/usr/bin/pkg-size
189/usr/lib
190/usr/lib/gentoolkit
191/usr/lib/gentoolkit/pym
192/usr/lib/gentoolkit/pym/glsa.py
193/usr/lib/gentoolkit/pym/gentoolkit.py
194/usr/sbin
195/usr/sbin/pkg-clean
196/usr/sbin/mkebuild
197/usr/share
198/usr/share/doc
199/usr/share/doc/gentoolkit-0.2.0_pre8
200/usr/share/doc/gentoolkit-0.2.0_pre8/NEWS
201/usr/share/doc/gentoolkit-0.2.0_pre8/TODO
202/usr/share/doc/gentoolkit-0.2.0_pre8/euse
203/usr/share/doc/gentoolkit-0.2.0_pre8/euse/TODO
204/usr/share/doc/gentoolkit-0.2.0_pre8/euse/README
205/usr/share/doc/gentoolkit-0.2.0_pre8/euse/AUTHORS
206/usr/share/doc/gentoolkit-0.2.0_pre8/euse/ChangeLog
207/usr/share/doc/gentoolkit-0.2.0_pre8/qpkg
208/usr/share/doc/gentoolkit-0.2.0_pre8/qpkg/README
209/usr/share/doc/gentoolkit-0.2.0_pre8/qpkg/AUTHORS
210/usr/share/doc/gentoolkit-0.2.0_pre8/qpkg/ChangeLog
211/usr/share/doc/gentoolkit-0.2.0_pre8/etcat
212/usr/share/doc/gentoolkit-0.2.0_pre8/etcat/README
213/usr/share/doc/gentoolkit-0.2.0_pre8/etcat/AUTHORS
214/usr/share/doc/gentoolkit-0.2.0_pre8/revdep-rebuild
215/usr/share/doc/gentoolkit-0.2.0_pre8/revdep-rebuild/TODO
216/usr/share/doc/gentoolkit-0.2.0_pre8/revdep-rebuild/README
217/usr/share/doc/gentoolkit-0.2.0_pre8/revdep-rebuild/AUTHORS
218/usr/share/doc/gentoolkit-0.2.0_pre8/README
219/usr/share/doc/gentoolkit-0.2.0_pre8/equery
220/usr/share/doc/gentoolkit-0.2.0_pre8/equery/README
221/usr/share/doc/gentoolkit-0.2.0_pre8/equery/AUTHORS
222/usr/share/doc/gentoolkit-0.2.0_pre8/AUTHORS
223/usr/share/doc/gentoolkit-0.2.0_pre8/gentoolkit
224/usr/share/doc/gentoolkit-0.2.0_pre8/gentoolkit/TODO
225/usr/share/doc/gentoolkit-0.2.0_pre8/gentoolkit/README
226/usr/share/doc/gentoolkit-0.2.0_pre8/gentoolkit/AUTHORS
227/usr/share/doc/gentoolkit-0.2.0_pre8/gentoolkit/ChangeLog
228/usr/share/doc/gentoolkit-0.2.0_pre8/ChangeLog
229/usr/share/doc/gentoolkit-0.2.0_pre8/COPYING
230/usr/share/man
231/usr/share/man/man1
232/usr/share/man/man1/revdep-rebuild.1.gz
233/usr/share/man/man1/mkebuild.1.gz
234/usr/share/man/man1/qpkg.1.gz
235/usr/share/man/man1/pkg-clean.1.gz
236/usr/share/man/man1/etcat.1.gz
237/usr/share/man/man1/ewhich.1.gz
238/usr/share/man/man1/equery.1.gz
239/usr/share/man/man1/euse.1.gz
240/usr/share/man/man1/dep-clean.1.gz
241/usr/share/man/man1/pkg-size.1.gz
242</pre>
243
244<note>
245In case you have gentoolkit-dev installed, <c>qpkg</c> will list out files for
246that as well, i.e. it displays the file list for all installed packages with
247the name gentoolkit.
248</note>
249
250</body>
251</section>
252<section>
253<title>Finding the Package That a File Came From</title>
254<body>
255
256<p>
257To find the package that a file came from, use the <c>-f</c> or
258<c>--find-file</c> flag.
259</p>
260
261<pre caption="Finding the ebuild that installed a given file">
262# <i>qpkg -f /usr/lib/mozilla</i>
263net-www/mozilla *
264</pre>
265
266</body>
267</section>
268<section>
269<title>Listing Duplicate Packages</title>
270<body>
271
272<p>
273Sometimes multiple versions of the same package may exist. <c>qpkg --dups</c>
274will print a list of duplicate packages. The existence of a duplicate package
275though may not indicate that the older version may be removed. They may fill
276different slots. To look for duplicates in the same slot, use <c>qpkg --dups
277--slot</c>. I just updated KDE from 3.0 to 3.0.2, so I have some duplicates in
278the same slot.
279</p>
280
281<pre caption="Finding duplicate packages">
282# <i>qpkg --dups --slot</i>
283app-portage/gentoolkit
284kde-base/kdeaddons
285kde-base/kdeadmin
286kde-base/kdeartwork
287kde-base/kdebase
288kde-base/kdegames
289kde-base/kdelibs
290kde-base/kdemultimedia
291kde-base/kdenetwork
292kde-base/kdetoys
293kde-base/kdeutils
294media-libs/freetype
295x11-libs/qt
296</pre>
297
298</body>
299</section>
300<section>
301<title>Verifying Package Integrity</title>
302<body>
303
304<p>
305Sometimes it is useful to check a package's integrity to know that files have
306not been replaced since they were installed. <c>qpkg</c> can verify md5 sums as
307well as install times to indicate whether files for the package might have been
308corrupted, replaced, or removed.
309</p>
310
311<p>
312To check both mtimes and md5 sums, use the <c>-c</c> flag.
313</p>
314
315<pre caption="See the Difference?">
316# <i>qpkg cdrtools -c -v</i>
317app-cdr/cdrtools-2.01_alpha25 *
318/etc/default/rscsi.dfl !mtime!
319/usr/bin/devdump !md5! !mtime!
320/usr/bin/mkisofs !md5! !mtime!
321/usr/bin/isovfy !md5! !mtime!
322/usr/bin/readcd !md5! !mtime!
323/usr/bin/cdda2wav !md5! !mtime!
324/usr/bin/cdrecord !md5! !mtime!
325/usr/bin/isodump !md5! !mtime!
326/usr/bin/isoinfo !md5! !mtime!
327/usr/lib/libfile.a !md5! !mtime!
328/usr/lib/librscg.a !md5! !mtime!
329/usr/lib/libunls.a !md5! !mtime!
330/usr/lib/libedc_ecc.a !md5! !mtime!
331/usr/lib/libdeflt.a !md5! !mtime!
332/usr/lib/libhfs.a !md5! !mtime!
333/usr/lib/libscg.a !md5! !mtime!
334/usr/lib/libparanoia.a !md5! !mtime!
335/usr/lib/libschily.a !md5! !mtime!
336/usr/sbin/rscsi !md5! !mtime!
337/usr/share/man/man1/cdrecord.1.gz !md5! !mtime!
338/usr/share/man/man1/readcd.1.gz !md5! !mtime!
339/usr/share/man/man1/cdda2wav.1.gz !md5! !mtime!
340/usr/share/man/man8/mkisofs.8.gz !md5! !mtime!
34176/150
342
343app-cdr/cdrtools-2.01_alpha37 *
3440/122
345</pre>
346
347<p>
348As you can see, I have more than one version of cdrtools installed. <c>qpkg</c>
349reports that many of the files from the older version have been changed since I
350installed it. Those packages were most likely modified when I updated from
351<path>cdrtools-2.01_alpha25</path> to <path>cdrtools-2.01_alpha37</path>. Note
352that the last two lines indicate that 0 of 122 files from <path>cdrtools-2.01
353_alpha37</path> have been changed since I installed. That is good. If any of
354them had been changed, I would be worried.
355</p>
356
357</body>
358</section>
359<section>
360<title>But Wait... There's More</title>
361<body>
362
363<p>
364<c>qpkg</c> can be used for other querying tasks that I will not cover here.
365There is a very complete man page for <c>qpkg</c>. Please read it for more
366information.
367</p> 103</p>
368 104
369</body> 105</body>
370</section> 106</section>
371</chapter> 107</chapter>
375<section> 111<section>
376<title>Introduction</title> 112<title>Introduction</title>
377<body> 113<body>
378 114
379<p> 115<p>
380<c>equery</c> is a tool that supports features that <c>qpkg</c> and <c>epm</c> 116<c>equery</c> is a tool that displays a great deal of useful information about
381have but has its own set of features that make it really useful. <c>equery 117the packages on your system and much more. <c>equery --help</c> gives you the
382--help</c> gives you the full set of options. <c>equery</c> will eventually 118full set of options.
383replace <c>etcat</c> at some point of time.
384</p> 119</p>
385 120
386<note> 121<note>
387Not all features listed by <c>equery --help</c> have been implemented yet. 122Not all features listed by <c>equery --help</c> have been implemented yet.
388Those that have not been, are mentioned clearly. 123Those that have not been, are mentioned clearly. You will also see that
124every command has a short option, e.g. <c>b</c> instead of <c>belongs</c>.
389</note> 125</note>
390 126
127<note>
128Be aware that equery currently changes the format of the output if it is sent
129through a pipe. The piped format is intended to be easier to parse by tools, but
130you can also turn it off by adding the <c>--no-pipe</c> option. If you write
131scripts that employ equery, you should be aware of this.
132</note>
133
391</body> 134</body>
392</section>
393<section> 135</section>
394<title>Finding out Package Sizes</title>
395<body>
396
397<p>
398Ever been curious to find out how much space a specific package is occupying?
399Since a package could have its files over a number of directories, the usual
400<c>du -hc</c> might not give you the correct figure. Not to worry, here comes
401<c>equery</c> to the rescue!
402</p>
403
404<pre caption="Package Size">
405# <i>equery size openoffice-bin</i>
406* app-office/openoffice-bin-1.1.2
407 Total Files : 2908
408 Total Size : 223353.31 KiB
409</pre>
410
411<p>
412As you can see, <c>equery</c> prints the total space used in kilobytes and also
413lists the total number of files the package has.
414</p>
415
416</body>
417</section> 136<section>
137<title>Finding the Package That a File Came From</title>
138<body>
139
140<p>
141<c>equery</c> also provides the functionality of finding the package that a
142file came from, using <c>belongs</c> command (or just <c>b</c>).
143</p>
144
145<pre caption="Finding the ebuild that installed a given file">
146# <i>equery belongs /usr/bin/audacious</i>
147[ Searching for file(s) /usr/bin/audacious in *... ]
148media-sound/audacious-1.1.2 (/usr/bin/audacious)
149</pre>
150
151<p>
152By using the <c>-f</c> option, you may search for packages with files
153matching any regular expression. The <c>-e</c> option is useful for
154terminating your search immediately when a match is found.
155</p>
156
157</body>
418<section> 158</section>
419<title>Package-wise list of USE Flags</title>
420<body>
421
422<p>
423<c>equery</c> can be used to give us information about what USE flags are being
424used by a specific package. It tells us what our current USE flags are for a
425package and what USE flags are available for the package.
426</p>
427
428<pre caption="Set and Unset USE Flags">
429# <i>equery uses ethereal</i>
430[ Colour Code : set unset ]
431[ Legend : (U) Col 1 - Current USE flags ]
432[ : (I) Col 2 - Installed With USE flags ]
433
434 U I [ Found these USE variables in : net-analyzer/ethereal-0.10.6 ]
435 - - adns : Adds support for the adns DNS client library
436 + + gtk : Adds support for x11-libs/gtk+ (The GIMP Toolkit)
437 - - ipv6 : Adds support for IP version 6
438 - - snmp : Adds support for the Simple Network Management Protocol if available
439 + + ssl : Adds support for Secure Socket Layer connections
440 + + gtk2 : Use gtk+-2.0.0 over gtk+-1.2 in cases where a program supports both.
441 - - debug : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too
442</pre>
443
444<p>
445I have installed ethereal with only the gtk, ssl and gtk2 flags set, but the
446other USE flags for ethereal are adns, ipv6, snmp and debug. For more
447information on USE flags, please refer to the <uri
448link="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=1">USE
449Flags</uri> chapter of the <uri
450link="http://www.gentoo.org/doc/en/handbook/">Gentoo Handbook</uri>.
451</p>
452
453</body>
454</section> 159<section>
160<title>Verifying Package Integrity</title>
161<body>
162
163<p>
164Sometimes it is useful to check a package's integrity. <c>equery</c> can
165verify md5 sums as well as timestamps to indicate when a package might
166have been corrupted, replaced, or removed.
167</p>
168
169<pre caption="OK package integrity">
170# <i>equery check gentoolkit</i>
171[ Checking app-portage/gentoolkit-0.2.0 ]
172 * 54 out of 54 files good
173</pre>
174
175<p>
176Please note that if you change configuration files after installation,
177these may be reported as "not good".
178</p>
179
180</body>
455<section> 181</section>
456<title>Where's the ebuild?</title> 182<section>
183<title>List of all packages depending on ...</title>
457<body> 184<body>
458 185
459<p>
460We can also find out which ebuild is being used for a specific package using
461<c>equery</c>. This is done my using the <c>equery which</c> command which
462displays the full path to the ebuild.
463</p> 186<p>
187<c>equery</c> is able to list all direct dependencies matching a package.
188The function we should use to do this is <c>depends</c> and it's as easy as:
189</p>
464 190
465<pre caption="Displaying the ebuild path"> 191<pre caption="Looking for packages depending on pygtk">
466# <i>equery which cdrtools</i> 192# <i>equery depends pygtk</i>
467/usr/portage/app-cdr/cdrtools/cdrtools-2.01_alpha37.ebuild 193[ Searching for packages depending on pygtk... ]
194app-office/dia-0.93
195dev-python/gnome-python-2.0.0-r1
196gnome-extra/gdesklets-core-0.26.2
197media-gfx/gimp-2.0.4
198x11-libs/vte-0.11.11-r1
468</pre> 199</pre>
469 200
470</body> 201</body>
471</section> 202</section>
472<section> 203<section>
473<title>Dependency Graphs</title> 204<title>Dependency Graphs</title>
474<body> 205<body>
475 206
476<p> 207<p>
477<c>equery</c> is capable of giving us a dependency graph for a specified package. 208<c>equery</c> is capable of giving us a dependency graph for a specified
478The dependency graph gives a listing of all the packages that have direct and 209package. The dependency graph gives a listing of all the packages that have
479indirect dependencies on the package in question. 210direct and indirect dependencies on the package in question.
480</p> 211</p>
481 212
482<pre caption="Dependency Graph for cdrtools"> 213<pre caption="Dependency Graph for cdrtools">
483# <i>equery depgraph cdrtools</i> 214# <i>equery depgraph cdrtools</i>
484Displaying dependencies for app-cdr/cdrtools-2.01_alpha37 215Displaying dependencies for app-cdr/cdrtools-2.01_alpha37
488 `-- sys-apps/baselayout-1.10.4 219 `-- sys-apps/baselayout-1.10.4
489 `-- sys-apps/sysvinit-2.85-r1 220 `-- sys-apps/sysvinit-2.85-r1
490 `-- sys-apps/gawk-3.1.3-r1 221 `-- sys-apps/gawk-3.1.3-r1
491 `-- sys-apps/util-linux-2.12-r4 222 `-- sys-apps/util-linux-2.12-r4
492 `-- sys-apps/sed-4.0.9 223 `-- sys-apps/sed-4.0.9
493 `-- sys-libs/ncurses-5.4-r4 224 `-- sys-libs/ncurses-5.4-r4
494 `-- sys-apps/pam-login-3.14 225 `-- sys-apps/pam-login-3.14
495 `-- sys-libs/pam-0.77-r1 226 `-- sys-libs/pam-0.77-r1
496 `-- sys-libs/cracklib-2.7-r10 227 `-- sys-libs/cracklib-2.7-r10
497 `-- sys-apps/miscfiles-1.3-r1 228 `-- sys-apps/miscfiles-1.3-r1
498 `-- app-arch/gzip-1.3.5-r1 229 `-- app-arch/gzip-1.3.5-r1
499 `-- sys-apps/portage-2.0.50-r10 230 `-- sys-apps/portage-2.0.50-r10
500</pre> 231</pre>
501 232
502<p> 233<p>
503For example, while glibc may be a direct dependency for cdrtools, the linux-headers 234For example, while glibc is a direct dependency for cdrtools,linux-headers
504are an indirect dependency for cdrtools. 235are an indirect dependency. Note that the output also includes information
236about virtual packages. In the example above, <c>cdrtools</c> is actually
237written to require virtual/libc, not sys-libs/glibc, but on the given
238system in the example sys-libs/glibc provides virtual/libc.
239</p>
240
241</body>
242</section>
243<section>
244<title>Listing Files Belonging to an Ebuild</title>
245<body>
246
505</p> 247<p>
248<c>equery</c> can list the files that belong to an installed ebuild. If I
249don't know the files that Gentoolkit has installed on the system, I will
250use <c>equery</c> to show them.
251</p>
252
253<pre caption="Listing files">
254# <i>equery files gentoolkit</i>
255[ Searching for packages matching gentoolkit... ]
256app-portage/gentoolkit-0.2.0
257* Contents of app-portage/gentoolkit-0.2.0:
258/usr
259/usr/bin
260/usr/bin/equery
261/usr/bin/etcat
262/usr/bin/euse
263/usr/bin/glsa-check
264/usr/bin/qpkg
265/usr/bin/revdep-rebuild
266/usr/lib
267/usr/lib/gentoolkit
268/usr/lib/gentoolkit/pym
269/usr/lib/gentoolkit/pym/gentoolkit
270/usr/lib/gentoolkit/pym/gentoolkit/__init__.py
271/usr/lib/gentoolkit/pym/gentoolkit/gentoolkit.py
272/usr/lib/gentoolkit/pym/gentoolkit/pprinter.py
273/usr/lib/gentoolkit/pym/glsa.py
274/usr/sbin
275/usr/share
276/usr/share/doc
277/usr/share/doc/gentoolkit-0.2.0_pre10
278
279[...]
280</pre>
281
282<p>
283The command <c>files</c> of <c>equery</c> provide some options to modify
284the output. You can look them all up in the <c>equery</c> man page.
285</p>
286
287</body>
288</section>
289<section>
290<title>Looking for packages that use a specific USE flag</title>
291<body>
292
293<p>
294If you want to find which packages on your system that make use of a specific
295USE flag, <c>equery</c> has the function <c>hasuse</c>:
296</p>
297
298<pre caption="Searching packages which use the firefox USE flag">
299# <i>equery hasuse firefox</i>
300[ Searching for USE flag firefox in all categories among: ]
301 * installed packages
302[I--] [ ] dev-python/gnome-python-extras-2.14.0-r1 (0)
303[I--] [ ] media-video/totem-2.16.4 (0)
304</pre>
305
306</body>
307</section>
308<section>
309<title>Listing Packages</title>
310<body>
311
312<p>
313<c>equery</c> has a power feature to list packages belonging to our system,
314portage or even an overlay. Let's try this:
315</p>
316
317<pre caption="Listing packages with equery">
318# <i>equery list gentoolkit</i>
319[ Searching for package 'gentoolkit' in all categories among: ]
320 * installed packages
321[I--] [ ] app-portage/gentoolkit-0.2.0 (0)
322</pre>
323
324<p>
325The standard query will search our installed packages for the name given.
326If found, the following info will be displayed: the package location between
327the first square brackets (I for Installed packages, P for Portage, O for
328Overlay), the possible masks between the second (~ by keyword, - by arch or
329M hard masked), then the category and complete name and last of all, the slot
330in which the package is stored.
331</p>
332
333<p>
334Another example, this time we are going to use the local options in order
335to look for packages in our portage tree and overlay.
336</p>
337
338<pre caption="Using local options with equery">
339# <i>equery list -p -o vim</i>
340[ Searching for package 'vim' in all categories among: ]
341 * installed packages
342[I--] [ ] app-editors/vim-6.3-r4 (0)
343 * Portage tree (/usr/portage)
344[-P-] [M~] app-editors/vim-7.0_alpha20050126 (0)
345[-P-] [M~] app-editors/vim-7.0_alpha20050201 (0)
346[-P-] [ ] app-editors/vim-6.3-r2 (0)
347[-P-] [M~] app-editors/vim-7.0_alpha20050122 (0)
348[-P-] [M~] app-editors/vim-core-7.0_alpha20050126 (0)
349[-P-] [ ] app-editors/vim-core-6.3-r3 (0)
350[-P-] [M~] app-editors/vim-core-7.0_alpha20050122 (0)
351[-P-] [M~] app-editors/vim-core-7.0_alpha20050201 (0)
352[-P-] [ ] app-editors/vim-core-6.3-r4 (0)
353 * overlay tree (/opt/ebuilds)
354</pre>
355
356</body>
357</section>
358<section>
359<title>Finding Package Sizes</title>
360<body>
361
362<p>
363Ever been curious to find out how much space a specific package is occupying?
364Since a package could have its files over a number of directories, the usual
365<c>du -hc</c> might not give you the correct figure. Not to worry, here comes
366<c>equery</c> to the rescue!
367</p>
368
369<pre caption="Package Size">
370# <i>equery size openoffice-bin</i>
371* app-office/openoffice-bin-1.1.2
372 Total Files : 2908
373 Total Size : 223353.31 KiB
374</pre>
375
376<p>
377As you can see, <c>equery</c> prints the total space used in kilobytes and
378also lists the total number of files the package has.
379</p>
380
381</body>
382</section>
383<section>
384<title>Package-wise list of USE Flags</title>
385<body>
386
387<p>
388<c>equery</c> can be used to give us information about what USE flags
389are being used by a specific package. It also tells us what our current USE
390flags are for a package and also what USE flags are available for the package.
391</p>
392
393<pre caption="Set and Unset USE Flags">
394# <i>equery uses wireshark</i>
395[ Colour Code : set unset ]
396[ Legend : (U) Col 1 - Current USE flags ]
397[ : (I) Col 2 - Installed With USE flags ]
398
399 U I [ Found these USE variables in : net-analyzer/wireshark-0.99.4 ]
400 - - adns : Adds support for the adns DNS client library
401 + + gtk : Adds support for x11-libs/gtk+ (The GIMP Toolkit)
402 - - ipv6 : Adds support for IP version 6
403 - - kerberos : Adds kerberos support
404 - - portaudio : Adds support for the crossplatform portaudio audio API
405 - - selinux : !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
406 - - snmp : Adds support for the Simple Network Management Protocol if available
407 + + ssl : Adds support for Secure Socket Layer connections
408 - - threads : Adds threads support for various packages. Usually pthreads
409</pre>
410
411<p>
412I have installed wireshark with only the gtk and ssl flags set, but there are
413several other USE flags for wireshark still available. For more information on
414USE flags, please refer to the <uri
415link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=2">USE Flags</uri>
416chapter of the <uri link="/doc/en/handbook/">Gentoo Handbook</uri>.
417</p>
418
419</body>
420</section>
421<section>
422<title>Where's the ebuild?</title>
423<body>
424
425<p>
426We can also find out which ebuild is being used for a specific package using
427<c>equery</c>. This is done by using the <c>equery which</c> command which
428displays the full path to the ebuild.
429</p>
430
431<pre caption="Displaying the ebuild path">
432# <i>equery which cdrtools</i>
433/usr/portage/app-cdr/cdrtools/cdrtools-2.01_alpha37.ebuild
434</pre>
506 435
507</body> 436</body>
508</section> 437</section>
509</chapter> 438</chapter>
510 439
515<body> 444<body>
516 445
517<p> 446<p>
518<c>euse</c> is a tool to see, set and unset USE flags at various places. For 447<c>euse</c> is a tool to see, set and unset USE flags at various places. For
519more information on USE flags, please refer to the <uri 448more information on USE flags, please refer to the <uri
520link="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=1">USE 449link="/doc/en/handbook/handbook-x86.xml?part=2&amp;chap=2">USE Flags</uri>.
521Flags</uri>. <c>euse -i</c> lists all USE flags. 450Please see <c>euse -h</c> for complete help and all options.
522</p> 451</p>
523 452
524</body> 453</body>
525</section>
526<section> 454</section>
455<section>
527<title>Reading, Setting and Unsetting USE Flags</title> 456<title>Viewing, Setting and Unsetting USE Flags</title>
528<body> 457<body>
529 458
530<p>
531The <c>euse --conf</c> command reads the current USE flags set/unset from
532make.conf.
533</p> 459<p>
534 460The <c>euse -a</c> command reads the current active USE flags and displays
535<pre caption="Viewing Current flags from make.conf"> 461them.
536# <i> euse --conf</i>
537USE setting in make.conf:
538alsa acpi apache2 cups cdr crypt cscope -doc ethereal fbcon gif gimpprint gnome
539gpm gstreamer gtk2 gtkhtml imlib imlib2 innodb -java javascript jpeg libg++ libwww
540mad md5sum mikmod mmx motif mozilla mpeg mpeg4 mysql ncurses oggvorbis odbc
541offensive opengl pam pdflib perl png python quicktime readline sdl spell sse ssl
542svga tcltk tiff truetype usb vanilla X xml2 xmms xosd xv xvid x86 zlib
543</pre>
544
545<p> 462</p>
546Setting a USE flag is done with the help of the <c>euse --enable</c> command 463
547which requires a mandatory flag name argument. If the flag is not already set, 464<note>
548<c>euse</c> appends the USE flag to the end of the current USE flag settings. 465There are 5 &quot;columns&quot; that <c>euse</c> now uses to show whether a
549In case the USE flag is invalid, there is a warning. Removing a USE flag is 466flag is set/unset and where all the flag has been set. The columns are as
550done using the <c>euse --disable</c> command. If an invalid flag is specified, 467follows -- +/-, set in the Environment, set in make.Conf, set in make.Defaults,
551the user is warned suitably. If the flag is present, it is unset with a -flag 468and set in make.Globals. The output looks like [+ECDG].
552in make.conf 469</note>
470
471<pre caption="Viewing all active USE flags">
472# <i>euse -a</i>
473X [+ CD ]
474aalib [+ ]
475acpi [+ C ]
476alsa [+ C ]
477apache2 [+ C ]
478apm [+ D ]
479avi [+ D ]
480berkdb [+ D ]
481bitmap-fonts [+ D ]
482bonobo [+ ]
483cdr [+ C ]
484crypt [+ CD ]
485cscope [+ C ]
486cups [+ CD ]
487curl [+ ]
488emboss [+ D ]
489encode [+ D ]
490esd [+ ]
491fam [+ ]
492fbcon [+ C ]
493firefox [+ C ]
494font-server [+ D ]
495foomaticdb [+ D ]
496fortran [+ D ]
497gd [+ C ]
498gdbm [+ D ]
499gif [+ CD ]
500gimpprint [+ C ]
501gnome [+ CD ]
502gphoto2 [+ ]
503gpm [+ CD ]
504gstreamer [+ C ]
505gtk [+ D ]
506gtkhtml [+ C ]
507guile [+ ]
508imagemagick [+ ]
509imlib [+ CD ]
510innodb [+ ]
511ipv6 [+ D ]
512javascript [+ C ]
513jpeg [+ CD ]
514kde [+ D ]
515ldap [+ ]
516libg++ [+ CD ]
517libwww [+ CD ]
518mad [+ CD ]
519mbox [+ C ]
520md5sum [+ C ]
521mikmod [+ CD ]
522mmx [+ C ]
523motif [+ CD ]
524mp3 [+ ]
525mpeg [+ CD ]
526mpeg4 [+ C ]
527mysql [+ C ]
528ncurses [+ CD ]
529nls [+ D ]
530nvidia [+ C ]
531odbc [+ ]
532offensive [+ ]
533ogg [+ CD ]
534opengl [+ CD ]
535oss [+ D ]
536pam [+ CD ]
537pdflib [+ CD ]
538perl [+ CD ]
539png [+ CD ]
540python [+ CD ]
541qt [+ D ]
542quicktime [+ CD ]
543readline [+ CD ]
544ruby [+ ]
545sdl [+ CD ]
546slang [+ D ]
547spell [+ CD ]
548sse [+ C ]
549ssl [+ CD ]
550svga [+ CD ]
551tcltk [+ C ]
552tcpd [+ D ]
553tiff [+ C ]
554truetype [+ CD ]
555usb [+ C ]
556vanilla [+ C ]
557x86 [+ C ]
558xml [+ ]
559xosd [+ C ]
560xv [+ CD ]
561xvid [+ C ]
562zlib [+ CD ]
563</pre>
564
553</p> 565<p>
566Similarly you can use the <c>euse -a -g</c> command to only view active global
567USE flags. The <c>euse -a -l</c> command does the same for active local USE
568flags.<c>-g</c> &amp; <c>-l</c> are suboptions to <c>euse</c> and need an
569option before them (like <c>-a</c>) to function correctly.
570</p>
554 571
572<pre caption="Viewing active local USE flags">
573# <i>euse -a -l</i>
574bitmap-fonts [+ D ]
575font-server [+ D ]
576fortran [+ D ]
577gimpprint [+ C ]
578md5sum [+ C ]
579mpeg4 [+ C ]
580nvidia [+ C ]
581offensive [+ ]
582truetype [+ CD ]
583</pre>
584
585<p>
586We can also use <c>euse</c> to set or unset use flags. The commands used for
587this are <c>euse -E flagname</c> (enable a flag) and <c>euse -D flagname</c>
588(disable a flag).
589</p>
590
591<warn>
592Do not use the <c>euse -E</c> or <c>euse -D</c> commands by themselves (without
593a flag). It will set/unset ALL USE flags in <c>/etc/make.conf</c>. Although a
594backup is kept at <path>/etc/make.conf.euse_backup</path>, please be careful
595while using <c>euse -E</c> or <c>euse -D</c>.
596</warn>
597
555<pre caption="Setting a USE Flag, 3dfx"> 598<pre caption="Setting and Unsetting USE flags">
599<comment>(Enabling a USE Flag)</comment>
556# <i>euse --enable 3dfx</i> 600# <i> euse -E 3dfx</i>
557USE setting in make.conf after enabling: 601/etc/make.conf was modified, a backup copy has been placed at /etc/make.conf.euse_backup
558alsa acpi apache2 cups cdr crypt cscope -doc ethereal fbcon gif gimpprint gnome
559gpm gstreamer gtk2 gtkhtml imlib imlib2 innodb -java javascript jpeg libg++ libwww
560mad md5sum mikmod mmx motif mozilla mpeg mpeg4 mysql ncurses oggvorbis odbc
561offensive opengl pam pdflib perl png python quicktime readline sdl spell sse ssl
562svga tcltk tiff truetype usb vanilla X xml2 xmms xosd xv xvid x86 zlib 3dfx
563</pre>
564 602
565<pre caption="Unsetting a USE Flag, 3dfx"> 603<comment>(/etc/make.conf after the command)</comment>
604USE="alsa acpi apache2 -arts cups cdr crypt cscope -doc fbcon \
605 firefox gd gif gimpprint gnome gpm gstreamer gtkhtml imlib \
606 innodb -java javascript jpeg libg++ libwww mad mbox md5sum \
607 mikmod mmx motif mpeg mpeg4 mysql ncurses nvidia \
608 ogg odbc offensive opengl pam pdflib perl png python \
609 quicktime readline sdl spell sse ssl svga tcltk tiff truetype usb \
610 vanilla X xosd xv xvid x86 zlib 3dfx"
611
612<comment>(Disabling the USE Flag)</comment>
566# <i>euse --disable 3dfx</i> 613# <i> euse -D 3dfx</i>
567USE setting in make.conf after disabling: 614/etc/make.conf was modified, a backup copy has been placed at /etc/make.conf.euse_backup
568alsa acpi apache2 cups cdr crypt cscope -doc ethereal fbcon gif gimpprint gnome 615
569gpm gstreamer gtk2 gtkhtml imlib imlib2 innodb -java javascript jpeg libg++ libwww 616<comment>(/etc/make.conf after the command)</comment>
570mad md5sum mikmod mmx motif mozilla mpeg mpeg4 mysql ncurses oggvorbis odbc 617USE="alsa acpi apache2 -arts cups cdr crypt cscope -doc fbcon \
571offensive opengl pam pdflib perl png python quicktime readline sdl spell sse ssl 618 firefox gd gif gimpprint gnome gpm gstreamer gtkhtml imlib \
572svga tcltk tiff truetype usb vanilla X xml2 xmms xosd xv xvid x86 zlib -3dfx 619 innodb -java javascript jpeg libg++ libwww mad mbox md5sum \
620 mikmod mmx motif mpeg mpeg4 mysql ncurses nvidia \
621 ogg odbc offensive opengl pam pdflib perl png python \
622 quicktime readline sdl spell sse ssl svga tcltk tiff truetype usb \
623 vanilla X xosd xv xvid x86 zlib -3dfx"
573</pre> 624</pre>
574 625
575<note> 626<note>
576<c>euse</c> does not physically remove the flag from make.conf. It just adds a 627<c>euse</c> does not physically remove the flag from make.conf. It just adds a
577- (minus) before the flag to unset it. You may have to manually clean up your 628- (minus) before the flag to unset it. You may have to manually clean up your
591<p> 642<p>
592This tool is Gentoo's Reverse Dependency rebuilder. It will scan your installed 643This tool is Gentoo's Reverse Dependency rebuilder. It will scan your installed
593ebuilds to find packages that have become broken as a result of an upgrade of a 644ebuilds to find packages that have become broken as a result of an upgrade of a
594package they depend on. It can emerge those packages for you but it can also 645package they depend on. It can emerge those packages for you but it can also
595happen that a given package does not work anymore with the currently installed 646happen that a given package does not work anymore with the currently installed
596dependencies, in which cas you should upgrade the broken package to a more 647dependencies, in which case you should upgrade the broken package to a more
597recent version. revdep-rebuild will pass flags to emerge which lets you use the 648recent version. revdep-rebuild will pass flags to emerge which lets you use the
598<c>--pretend</c> flag to see what is going to be emerged again before you go any 649<c>--pretend</c> flag to see what is going to be emerged again before you go any
599further. 650further.
600</p> 651</p>
601 652
664the <c>-p</c> flag and the listed packages will be emerged again. 715the <c>-p</c> flag and the listed packages will be emerged again.
665</p> 716</p>
666 717
667</body> 718</body>
668</section> 719</section>
669
670<section> 720<section>
671<title>glsa-check</title> 721<title>glsa-check</title>
672<body> 722<body>
673 723
674<p> 724<p>
675<c>glsa-check</c> is mainly a test tool that keeps track of the various GLSA's 725<c>glsa-check</c> is mainly a test tool that keeps track of the various GLSA's
676(Gentoo Linux Security Advisory) and will eventually be integrated into 726(Gentoo Linux Security Advisory) and will eventually be integrated into
677<c>emerge</c> and <c>equery</c>. For more information, please visit the <uri 727<c>emerge</c> and <c>equery</c>. For more information, please visit the <uri
678link="http://www.gentoo.org/proj/en/portage/glsa-integration.xml">Portage GLSA 728link="/proj/en/portage/glsa-integration.xml">Portage GLSA Integration
679Integration Page</uri>. 729Page</uri>.
680</p> 730</p>
681 731
682</body> 732</body>
683</section> 733</section>
684</chapter> 734</chapter>
685 735

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.20