/[gentoo]/xml/htdocs/doc/en/handbook/hb-working-portage.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-working-portage.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download) (as text)
Tue Nov 25 17:34:47 2003 UTC (10 years, 4 months ago) by swift
Branch: MAIN
Changes since 1.1: +286 -3 lines
File MIME type: application/xml
I ve done some writing :)

1 swift 1.1 <!-- The content of this document is licensed under the CC-BY-SA license -->
2     <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3    
4 swift 1.2 <!-- $Header: /home/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.1 2003/11/20 10:52:35 swift Exp $ -->
5 swift 1.1
6     <sections>
7     <section>
8     <title>Obtaining Package Information</title>
9     <subsection>
10     <title>The Lord of All Tools: emerge</title>
11     <body>
12    
13 swift 1.2 <p>
14     We have briefly encountered <c>emerge</c> in the previous chapter, but not to
15     the extent that you are now able to work with it to its fullest potential. We
16     will fix that right now ;-)
17     </p>
18    
19     <p>
20     <c>emerge</c> is the command used to install, remove, query and maintain
21     software packages. It is a front-end for <c>ebuild</c>; people interested in
22     becoming Gentoo professionals will learn how to use <c>ebuild</c> later on. For
23     now, we will focus on <c>emerge</c> as it has functionality that <c>ebuild</c>
24     lacks (such as resolving dependencies, searching the Portage tree, etc.).
25     </p>
26    
27     <p>
28     Since <c>emerge</c> is the most important tool for Gentoo users, it has an
29     extensive manpage you can read by issuing <c>man emerge</c>. You can also view
30     the in-command help by running <c>emerge --help</c>.
31     </p>
32    
33     <pre caption="Retrieving help for emerge">
34     # <i>man emerge</i>
35     # <i>emerge --help</i>
36     </pre>
37    
38     </body>
39     </subsection>
40     <subsection>
41     <title>The Portage Tree</title>
42     <body>
43    
44     <p>
45     Before we continue describing <c>emerge</c>, let us first take a look at the
46     Portage Tree. Go to <path>/usr/portage</path> and do a listing of the available
47     directories.
48     </p>
49    
50     <pre caption="Viewing the Portage Tree">
51     # <i>cd /usr/portage; ls --classify</i>
52     <comment>(The --classify will append a special character to note the filetype)</comment>
53     app-admin/ dev-ml/ gnome-libs/ net-print/
54     app-arch/ dev-perl/ gnome-office/ net-wireless/
55     app-benchmarks/ dev-php/ header.txt net-www/
56     app-cdr/ dev-python/ incoming/ net-zope/
57     app-crypt/ dev-ruby/ jython/ packages/
58     app-dicts/ dev-tcltk/ kde-apps/ profiles/
59     app-doc/ dev-tex/ kde-base/ releases/
60     app-editors/ dev-util/ kde-i18n/ scripts/
61     app-emacs/ distfiles/ kde-libs/ sec-policy/
62     app-emulation/ eclass/ licenses/ skel.ChangeLog
63     app-games/ experimental/ media-fonts/ skel.ebuild
64     app-gnustep/ files/ media-gfx/ skel.metadata.xml
65     app-i18n/ fresco-base/ media-libs/ snapshots/
66     app-misc/ games-action/ media-plugins/ sys-apps/
67     app-office/ games-arcade/ media-radio/ sys-build/
68     app-pda/ games-board/ media-sound/ sys-cluster/
69     app-portage/ games-emulation/ media-tv/ sys-devel/
70     app-sci/ games-engines/ media-video/ sys-fs/
71     app-shells/ games-fps/ metadata/ sys-kernel/
72     app-text/ games-kids/ net-analyzer/ sys-kmods/
73     app-vim/ games-misc/ net-apache/ sys-libs/
74     app-xemacs/ games-mud/ net-dialup/ unix2tcp/
75     berlin-base/ games-puzzle/ net-dns/ x11-base/
76     dev-ada/ games-roguelike/ net-firewall/ x11-libs/
77     dev-cpp/ games-rpg/ net-fs/ x11-misc/
78     dev-db/ games-server/ net-ftp/ x11-plugins/
79     dev-dotnet/ games-simulation/ net-im/ x11-terms/
80     dev-embedded/ games-sports/ net-irc/ x11-themes/
81     dev-games/ games-strategy/ net-libs/ x11-wm/
82     dev-haskell/ games-util/ net-mail/ xfce-base/
83     dev-java/ glep/ net-misc/ xfce-extra/
84     dev-lang/ gnome-apps/ net-nds/
85     dev-libs/ gnome-base/ net-news/
86     dev-lisp/ gnome-extra/ net-p2p/
87     </pre>
88    
89     <p>
90     As you can see, the Portage tree has several subdirectories. Most of them are
91     the <e>categories</e> in which the Gentoo packages, called <e>ebuilds</e>,
92     reside. Take a look at, for instance, <path>app-office</path>:
93     </p>
94    
95     <pre caption="Viewing a category">
96     # <i>cd app-office; ls --classify</i>
97     abiword/ gnotime/ kmymoney2/ ooodi/ plan/ timestamp.x
98     dia/ gnucash/ koffice/ oooqs/ qhacc/
99     dia2code/ gnumeric/ lxbank/ openoffice/ sc/
100     facturalux/ ical/ lyx/ openoffice-bin/ scribus/
101     gaby/ kbudget/ mdbtools/ openoffice-ximian/ siag/
102     gnofin/ khacc/ mrproject/ phprojekt/ texmacs/
103     </pre>
104    
105     <p>
106     Inside a category you will find the packages belonging to that category, with a
107     seperate directory for each package. Let us take a look at the <c>openoffice</c>
108     package:
109     </p>
110    
111     <pre caption="Viewing a package">
112     # <i>cd openoffice; ls --classify</i>
113     ChangeLog files/ openoffice-1.0.3-r1.ebuild openoffice-1.1.0-r2.ebuild
114     Manifest metadata.xml openoffice-1.1.0-r1.ebuild openoffice-1.1.0.ebuild
115     </pre>
116    
117     <p>
118     Remember that we told you that a Gentoo package is called an ebuild? Well, in
119     the example directory four of such ebuilds are stored. Their naming is
120     almost identical: they only differ in the version name.
121     You are free to view the contents of such a package: they are plain scripts. We
122     will not discuss it right now as it isn't important to know if you plan on just
123     using Gentoo.
124     </p>
125    
126     <p>
127     The other files are the <path>ChangeLog</path> (which contains a listing of all
128     the changes done to the ebuilds), <path>Manifest</path> (which contains the
129     checksums and permissions of all the files in the directory) and
130     <path>metadata.xml</path> (which contains more information about the package,
131     such as the responsible development group -- called <e>herd</e> and a more
132     extensive description).
133     </p>
134    
135     <p>
136     Inside the <path>files</path> directory you will find extra files, needed by
137     Portage: digests (checksums and permissions of the files needed by a single
138     version of the package), patches, example configuration files, etc.
139     </p>
140    
141     <pre caption="Viewing the extra files">
142     # <i>cd files; ls --classify</i>
143     1.0.3/ digest-openoffice-1.0.3-r1 digest-openoffice-1.1.0-r1
144     1.1.0/ digest-openoffice-1.1.0 digest-openoffice-1.1.0-r2
145     # <i>cd 1.1.0; ls --classify</i>
146     fixed-gcc.patch ooffice-wrapper-1.3
147     newstlportfix.patch openoffice-1.1.0-linux-2.6-fix.patch
148     no-mozab.patch openoffice-1.1.0-sparc64-fix.patch
149     nptl.patch
150     </pre>
151    
152     <p>
153     If you go back to the root of the Portage tree (<path>/usr/portage</path>) you
154     will notice that there are other, non-category directories too. We will discuss
155     those later in this chapter.
156     </p>
157    
158 swift 1.1 </body>
159     </subsection>
160     <subsection>
161     <title>Search for a Package</title>
162     <body>
163    
164 swift 1.2 <p>
165     If you are new to Linux or Gentoo, you might not know what tool you need for
166     what job. To facilitate searching, <c>emerge</c> provides you with a way to
167     search through the available packages on your system. There are two ways you can
168     search through packages: by <e>name</e>, or by <e>name</e> and
169     <e>description</e>.
170     </p>
171    
172     <p>
173     To search through the Portage tree by name, use <c>emerge search</c>. For
174     instance, to find out more about <c>mozilla</c>:
175     </p>
176    
177     <pre caption="Showing information about mozilla">
178     # <i>emerge search mozilla</i>
179     Searching...
180     [ Results for search key : mozilla ]
181     [ Applications found : 5 ]
182     <comment>(Some output removed to improve readability)</comment>
183     * net-www/mozilla
184     Latest version available: 1.5-r1
185     Latest version installed: 1.4-r3
186     Size of downloaded files: 29,153 kB
187     Homepage: http://www.mozilla.org
188     Description: The Mozilla Web Browser
189    
190     * net-www/mozilla-firebird
191     Latest version available: 0.7
192     Latest version installed: [ Not Installed ]
193     Size of downloaded files: 37,850 kB
194     Homepage: http://www.mozilla.org/projects/firebird/
195     Description: The Mozilla Firebird Web Browser
196     <comment>(...)</comment>
197     </pre>
198    
199     <p>
200     If you want to include a search through the descriptions too, use the
201     <c>--searchdesc</c> argument:
202     </p>
203    
204     <pre caption="Search through the descriptions too">
205     # <i>emerge --searchdesc mozilla</i>
206     Searching...
207     [ Results for search key : mozilla ]
208     [ Applications found : 10 ]
209     <comment>(Some output removed to improve readability)</comment>
210     * dev-libs/nss-3.8
211     Latest version available: 3.8
212     Latest version installed: 3.8
213     Size of downloaded files: 2,782 kB
214     Homepage: http://www.mozilla.org/projects/security/pki/nss/
215     Description: Mozilla's Netscape Security Services Library that implements PKI support
216     </pre>
217    
218     <p>
219     As you can see, the output of <c>emerge</c> informs you about the category and
220     name of the package, the available version, the currently installed version,
221     the size of the downloaded files, the homepage and the small description.
222     </p>
223    
224     <p>
225     You see something new? Yes, <e>downloaded files</e>. When you tell Portage to
226     install a package, it ofcourse needs to have the necessary sources (or
227     precompiled packages) available. It therefor checks the contents of
228     <path>/usr/portage/distfiles</path> (for sourcecode) or
229     <path>/usr/portage/packages/All</path> (for precompiled packages) to see if the
230     necessary files are already available. If not, it downloads the necessary files
231     and places them in those directories.
232     </p>
233    
234     <note>
235     Searching the Portage Tree, especially when using <c>--searchdesc</c>, is very
236     time consuming. There are other, more performant tools available. We will
237     describe those in the chapter on <uri link="?part=2&amp;chap=7">Gentoolkit and
238     Other Tools</uri>.
239     </note>
240    
241 swift 1.1 </body>
242     </subsection>
243     </section>
244     <section>
245     <title>Updating Portage</title>
246     <subsection>
247 swift 1.2 <title>Introduction</title>
248     <body>
249    
250     <p>
251     Searching through Portage is nice, but if you don't update your Portage Tree
252     regularly, you will be stuck with the packages and versions available on your
253     system. This means that your system will get outdated pretty soon, and that
254     packages with possible security problems will remain on your system.
255     </p>
256    
257     <p>
258     There are several ways to update your Portage Tree. The most popular method is
259     by using one of our <uri link="/main/en/mirrors.xml">rsync mirrors</uri>.
260     Another one is by using a Portage snapshot (in case a firewall or unavailability
261     of a network prohibits the use of the rsync server).
262     </p>
263    
264     </body>
265     </subsection>
266     <subsection>
267     <title>Selecting a Mirror for rsync</title>
268 swift 1.1 <body>
269    
270 swift 1.2 <p>
271     It is adviseable to first select a fast <uri
272     link="/main/en/mirrors.xml">mirror</uri> close to you. You can do this manually
273     (by setting the <c>SYNC</c> variable in <path>/etc/make.conf</path>) or use
274     <c>mirrorselect</c> to do this for you automatically. As the <c>SYNC</c>
275     variable will be discussed later on, we will focus on using <c>mirrorselect</c>.
276     First install <c>mirrorselect</c> by emerging it:
277     </p>
278    
279     <pre caption="Installing mirrorselect">
280     # <i>emerge --usepkg mirrorselect</i>
281     </pre>
282    
283     <p>
284     Now run <c>mirrorselect</c> to automatically select mirrors for you (it will
285     also setup Portage to use a mirror for the sourcecode):
286     </p>
287    
288     <pre caption="Running mirrorselect">
289     # <i>mirrorselect -a -s3</i>
290     </pre>
291    
292 swift 1.1 </body>
293     </subsection>
294     <subsection>
295 swift 1.2 <title>Updating Portage</title>
296 swift 1.1 <body>
297 swift 1.2
298     <p>
299     To update Portage using rsync, simply run <c>emerge sync</c>:
300     </p>
301    
302     <pre caption="Updating Portage using emerge sync">
303     # <i>emerge sync</i>
304     </pre>
305    
306     <p>
307     If this fails (due to network problems, or a firewall), you can try using
308     <c>emerge-webrsync</c> which will download a Portage Tree snapshot using
309     <c>wget</c>. This also means that you can use proxies if you want. We discussed
310     how to setup your system to use proxies during the Gentoo installation.
311     </p>
312    
313     <pre caption="Updating Portage using emerge-webrsync">
314     # <i>emerge-webrsync</i>
315     </pre>
316 swift 1.1
317     </body>
318     </subsection>
319     </section>
320     <section>
321     <title>Maintaining Software</title>
322     <subsection>
323     <title>Installing Software</title>
324     <body>
325    
326     </body>
327     </subsection>
328     <subsection>
329     <title>Updating Software</title>
330     <body>
331    
332     </body>
333     </subsection>
334     <subsection>
335     <title>Removing Software</title>
336     <body>
337    
338     </body>
339     </subsection>
340     </section>
341     <section>
342     <title>Software Availability</title>
343     <subsection>
344     <title>ARCH or not?</title>
345     <body>
346    
347     </body>
348     </subsection>
349     <subsection>
350     <title>Masked Packages</title>
351     <body>
352    
353     </body>
354     </subsection>
355     <subsection>
356     <title>Blocked Packages</title>
357     <body>
358    
359     </body>
360     </subsection>
361     </section>
362     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20