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

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

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

Revision 1.3 Revision 1.6
1<!-- The content of this document is licensed under the CC-BY-SA license --> 1<!-- The content of this document is licensed under the CC-BY-SA license -->
2<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 2<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3 3
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.3 2003/11/26 20:19:59 swift Exp $ --> 4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.6 2003/11/27 14:45:38 swift Exp $ -->
5 5
6<sections> 6<sections>
7<section> 7<section>
8<title>Obtaining Package Information</title> 8<title>Obtaining Package Information</title>
9<subsection> 9<subsection>
10<title>The Lord of All Tools: emerge</title> 10<title>The Lord of All Tools: emerge</title>
11<body> 11<body>
12 12
13<p> 13<p>
14We have briefly encountered <c>emerge</c> in the previous chapter, but not to 14The main Portage tool that most users will use is <c>emerge</c>. We have already
15the extent that you are now able to work with it to its fullest potential. We 15used it during the Gentoo installation and in the previous chapter, but we just
16will fix that right now ;-) 16briefly explained how to use it. This chapter will elaborate on <c>emerge</c>
17and learn you how to use <c>emerge</c> to fix all your software-related needs.
17</p> 18</p>
18 19
19<p> 20<p>
20<c>emerge</c> is the command used to install, remove, query and maintain 21<c>emerge</c> is the command used to install, remove, query and maintain
21software packages. It is a front-end for <c>ebuild</c>; people interested in 22software packages. It is a front-end for <c>ebuild</c>; people interested in
42<body> 43<body>
43 44
44<p> 45<p>
45Before we continue describing <c>emerge</c>, let us first take a look at the 46Before we continue describing <c>emerge</c>, let us first take a look at the
46Portage Tree. Go to <path>/usr/portage</path> and do a listing of the available 47Portage Tree. Go to <path>/usr/portage</path> and do a listing of the available
47directories. 48directories. We use <c>ls --classify</c> to list the contents of a
49directory as it will show directories with a trailing "/".
48</p> 50</p>
49 51
50<pre caption="Viewing the Portage Tree"> 52<pre caption="Viewing the Portage Tree">
51# <i>cd /usr/portage; ls --classify</i> 53# <i>cd /usr/portage; ls --classify</i>
52<comment>(The --classify will append a special character to note the filetype)</comment>
53app-admin/ dev-ml/ gnome-libs/ net-print/ 54app-admin/ dev-ml/ gnome-libs/ net-print/
54app-arch/ dev-perl/ gnome-office/ net-wireless/ 55app-arch/ dev-perl/ gnome-office/ net-wireless/
55app-benchmarks/ dev-php/ header.txt net-www/ 56app-benchmarks/ dev-php/ header.txt net-www/
56app-cdr/ dev-python/ incoming/ net-zope/ 57app-cdr/ dev-python/ incoming/ net-zope/
57app-crypt/ dev-ruby/ jython/ packages/ 58app-crypt/ dev-ruby/ jython/ packages/
126<p> 127<p>
127The other files are the <path>ChangeLog</path> (which contains a listing of all 128The other files are the <path>ChangeLog</path> (which contains a listing of all
128the changes done to the ebuilds), <path>Manifest</path> (which contains the 129the changes done to the ebuilds), <path>Manifest</path> (which contains the
129checksums and permissions of all the files in the directory) and 130checksums and permissions of all the files in the directory) and
130<path>metadata.xml</path> (which contains more information about the package, 131<path>metadata.xml</path> (which contains more information about the package,
131such as the responsible development group -- called <e>herd</e> and a more 132such as the responsible development group -- called <e>herd</e> -- and a more
132extensive description). 133extensive description).
133</p> 134</p>
134 135
135<p> 136<p>
136Inside the <path>files</path> directory you will find extra files, needed by 137Inside the <path>files</path> directory you will find extra files, needed by
221the size of the downloaded files, the homepage and the small description. 222the size of the downloaded files, the homepage and the small description.
222</p> 223</p>
223 224
224<p> 225<p>
225You see something new? Yes, <e>downloaded files</e>. When you tell Portage to 226You see something new? Yes, <e>downloaded files</e>. When you tell Portage to
226install a package, it ofcourse needs to have the necessary sources (or 227install a package, it of course needs to have the necessary sources (or
227precompiled packages) available. It therefor checks the contents of 228precompiled packages) available. It therefore checks the contents of
228<path>/usr/portage/distfiles</path> (for sourcecode) or 229<path>/usr/portage/distfiles</path> (for sourcecode) or
229<path>/usr/portage/packages/All</path> (for precompiled packages) to see if the 230<path>/usr/portage/packages/All</path> (for precompiled packages) to see if the
230necessary files are already available. If not, it downloads the necessary files 231necessary files are already available. If not, it downloads the necessary files
231and places them in those directories. 232and places them in those directories.
232</p> 233</p>
265<body> 266<body>
266 267
267<p> 268<p>
268Searching through Portage is nice, but if you don't update your Portage Tree 269Searching through Portage is nice, but if you don't update your Portage Tree
269regularly, you will be stuck with the packages and versions available on your 270regularly, you will be stuck with the packages and versions available on your
270system. This means that your system will get outdated pretty soon, and that 271system. This means that your system will get outdated pretty soon and that
271packages with possible security problems will remain on your system. 272you will be missing bugfixes and remedies for possible security problems.
272</p> 273</p>
273 274
274<p> 275<p>
275There are several ways to update your Portage Tree. The most popular method is 276There are several ways to update your Portage Tree. The most popular method is
276by using one of our <uri link="/main/en/mirrors.xml">rsync mirrors</uri>. 277by using one of our <uri link="/main/en/mirrors.xml">rsync mirrors</uri>.
351As you probably have guessed, building packages takes a lot of time (especially 352As you probably have guessed, building packages takes a lot of time (especially
352if you have little resources or want to build big packages, such as <uri 353if you have little resources or want to build big packages, such as <uri
353link="http://www.kde.org">KDE</uri>, <uri 354link="http://www.kde.org">KDE</uri>, <uri
354link="http://www.openoffice.org">OpenOffice.org</uri>, etc.). By building the 355link="http://www.openoffice.org">OpenOffice.org</uri>, etc.). By building the
355package, you can use the <c>USE</c> setting to tweak the package to your system. 356package, you can use the <c>USE</c> setting to tweak the package to your system.
356Ofcourse, you can also define high optimization options (in the <c>CFLAGS</c> 357Of course, you can also define high optimization options (in the <c>CFLAGS</c>
357and <c>CXXFLAGS</c> variables) to compile the package with. 358and <c>CXXFLAGS</c> variables) to compile the package with.
358</p> 359</p>
359 360
360<p> 361<p>
361Using prebuild packages improves the installation time (as no more compilation 362Using prebuild packages improves the installation time (as no more compilation
430<pre caption="Installing a specific gnumeric version"> 431<pre caption="Installing a specific gnumeric version">
431# <i>emerge "&lt;gnumeric-1.2"</i> 432# <i>emerge "&lt;gnumeric-1.2"</i>
432</pre> 433</pre>
433 434
434<p> 435<p>
435Other possibilities are ofcourse "&gt;" (later version) and "=" (the exact 436Other possibilities are of course "&gt;" (later version) and "=" (the exact
436version). 437version).
437</p> 438</p>
438 439
439</body> 440</body>
440</subsection> 441</subsection>
512<pre caption="Installing a specific gnumeric version"> 513<pre caption="Installing a specific gnumeric version">
513# <i>emerge --usepkg "&lt;gnumeric-1.2"</i> 514# <i>emerge --usepkg "&lt;gnumeric-1.2"</i>
514</pre> 515</pre>
515 516
516<p> 517<p>
517Other possibilities are ofcourse "&gt;" (later version) and "=" (the exact 518Other possibilities are of course "&gt;" (later version) and "=" (the exact
518version). 519version).
519</p> 520</p>
520 521
521 522
522</body> 523</body>
618<pre caption="Upgrading your entire system"> 619<pre caption="Upgrading your entire system">
619# <i>emerge --update --upgradeonly world</i> 620# <i>emerge --update --upgradeonly world</i>
620</pre> 621</pre>
621 622
622<p> 623<p>
623Ofcourse, we are talking here about <e>system</e> and <e>world</e>, but you can 624Of course, we are talking here about <e>system</e> and <e>world</e>, but you can
624perform the same actions for individual software packages. 625perform the same actions for individual software packages.
625</p> 626</p>
626 627
627</body> 628</body>
628</subsection> 629</subsection>

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20