/[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.10 Revision 1.19
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
1<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
2<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3 6
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.10 2003/11/30 12:49:20 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.19 2004/01/09 10:52:18 dertobi123 Exp $ -->
5 8
6<sections> 9<sections>
7<section> 10<section>
8<title>Obtaining Package Information</title> 11<title>Obtaining Package Information</title>
9<subsection> 12<subsection>
12 15
13<p> 16<p>
14The main Portage tool that most users will use is <c>emerge</c>. We have already 17The main Portage tool that most users will use is <c>emerge</c>. We have already
15used it during the Gentoo installation and in the previous chapter, but we just 18used it during the Gentoo installation and in the previous chapter, but we just
16briefly explained how to use it. This chapter will elaborate on <c>emerge</c> 19briefly 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. 20and teach you how to use <c>emerge</c> to fix all your software-related needs.
18</p> 21</p>
19 22
20<p> 23<p>
21<c>emerge</c> is the command used to install, remove, query and maintain 24<c>emerge</c> is the command used to install, remove, query and maintain
22software packages. It is a front-end for <c>ebuild</c>; people interested in 25software packages. It is a front-end for <c>ebuild</c>; people interested in
103gnofin/ khacc/ mrproject/ phprojekt/ texmacs/ 106gnofin/ khacc/ mrproject/ phprojekt/ texmacs/
104</pre> 107</pre>
105 108
106<p> 109<p>
107Inside a category you will find the packages belonging to that category, with a 110Inside a category you will find the packages belonging to that category, with a
108seperate directory for each package. Let us take a look at the <c>openoffice</c> 111separate directory for each package. Let us take a look at the <c>openoffice</c>
109package: 112package:
110</p> 113</p>
111 114
112<pre caption="Viewing a package"> 115<pre caption="Viewing a package">
113# <i>cd openoffice; ls --classify</i> 116# <i>cd openoffice; ls --classify</i>
224 227
225<p> 228<p>
226You see something new? Yes, <e>downloaded files</e>. When you tell Portage to 229You see something new? Yes, <e>downloaded files</e>. When you tell Portage to
227install a package, it of course needs to have the necessary sources (or 230install a package, it of course needs to have the necessary sources (or
228precompiled packages) available. It therefore checks the contents of 231precompiled packages) available. It therefore checks the contents of
229<path>/usr/portage/distfiles</path> (for sourcecode) or 232<path>/usr/portage/distfiles</path> (for source code) or
230<path>/usr/portage/packages/All</path> (for precompiled packages) to see if the 233<path>/usr/portage/packages/All</path> (for precompiled packages) to see if the
231necessary files are already available. If not, it downloads the necessary files 234necessary files are already available. If not, it downloads the necessary files
232and places them in those directories. 235and places them in those directories.
233</p> 236</p>
234 237
238<!--
235<note> 239<note>
236Searching the Portage Tree, especially when using <c>--searchdesc</c>, is very 240Searching the Portage Tree, especially when using <c>- -searchdesc</c>, is very
237time consuming. There are other, more performant tools available. We will 241time consuming. There are other, more performant tools available. We will
238describe those in the chapter on <uri link="?part=2&amp;chap=7">Gentoolkit and 242describe those in the chapter on <uri link="?part=2&amp;chap=7">Gentoolkit and
239Other Tools</uri>. 243Other Tools</uri>.
240</note> 244</note>
245-->
241 246
242</body> 247</body>
243</subsection> 248</subsection>
244<subsection> 249<subsection>
245<title>Viewing the ChangeLog</title> 250<title>Viewing the ChangeLog</title>
246<body> 251<body>
247 252
248<p> 253<p>
249While browsing through the Portage Tree, you saw that there was a ChangeLog for 254While browsing through the Portage Tree, you saw that there was a ChangeLog for
250each package. You can view this ChangeLog with <c>emerge</c> too. Use the 255each package. You can view the ChangeLog entries between the available version
256and the installed version with <c>emerge</c> too. Use the
251<c>--pretend --changelog</c> (<c>-pl</c> in short) options. As an example we 257<c>--pretend --changelog</c> (<c>-pl</c> in short) options. As an example we
252will view the ChangeLog entries for <c>gnumeric</c>: 258will view the ChangeLog entries for <c>gnumeric</c>:
253</p> 259</p>
254 260
255<pre caption="Viewing the ChangeLog entries for gnumeric"> 261<pre caption="Viewing the ChangeLog entries for gnumeric">
256# <i>emerge --pretend --changelog gnumeric</i> 262# <i>emerge --pretend --changelog gnumeric</i>
263<comment>(Some output removed to improve readability)</comment>
264*gnumeric-1.2.2
265
266 27 Nov 2003; foser &lt;foser@gentoo.org&gt; gnumeric-1.2.2.ebuild :
267 New release, requested in #34492
268 updated deps
269
270 12 Nov 2003; Jason Wever &lt;weeve@gentoo.org&gt; gnumeric-1.2.0.ebuild:
271 Marked stable on sparc, fixes bug #32405.
272
273 14 Oct 2003; Jason Wever &lt;weeve@gentoo.org&gt; gnumeric-1.0.8.ebuild:
274 Added ~sparc keyword. Fixes bug #31150.
257</pre> 275</pre>
258 276
259</body> 277</body>
260</subsection> 278</subsection>
261</section> 279</section>
298# <i>emerge --usepkg mirrorselect</i> 316# <i>emerge --usepkg mirrorselect</i>
299</pre> 317</pre>
300 318
301<p> 319<p>
302Now run <c>mirrorselect</c> to automatically select mirrors for you (it will 320Now run <c>mirrorselect</c> to automatically select mirrors for you (it will
303also setup Portage to use a mirror for the sourcecode): 321also setup Portage to use a mirror for the source code):
304</p> 322</p>
305 323
306<pre caption="Running mirrorselect"> 324<pre caption="Running mirrorselect">
307# <i>mirrorselect -a -s3</i> 325# <i>mirrorselect -a -s3</i>
308</pre> 326</pre>
341<title>Building or Prebuilt?</title> 359<title>Building or Prebuilt?</title>
342<body> 360<body>
343 361
344<p> 362<p>
345Gentoo provides ebuilds, the Gentoo packages if you like. But when you want to 363Gentoo provides ebuilds, the Gentoo packages if you like. But when you want to
346install such an ebuild, you can choose between <e>building</e> the package, or 364install such an ebuild, you can choose between <e>building</e> the package and
347using a <e>prebuilt</e> package. But what are the advantages/disadvantages of 365using a <e>prebuilt</e> package. But what are the advantages/disadvantages of
348both approaches, and can they be used next to each other? 366both approaches, and can they be used next to each other?
349</p> 367</p>
350 368
351<p> 369<p>
364<c>CFLAGS</c> &amp; <c>CXXFLAGS</c> variables. 382<c>CFLAGS</c> &amp; <c>CXXFLAGS</c> variables.
365</p> 383</p>
366 384
367<p> 385<p>
368As previously stated, prebuilt packages are stored in the 386As previously stated, prebuilt packages are stored in the
369<path>/usr/portage/packages/All</path> directory, while the sourcecode of the 387<path>/usr/portage/packages/All</path> directory, while the source code of the
370packages are placed in <path>/usr/portage/distfiles</path>. If you have finished 388packages is placed in <path>/usr/portage/distfiles</path>. If you have finished
371installing a package you can remove the package or sourcecode from the 389installing a package you can remove the package or source code from the
372respective directory. However, you might want to keep the package/sourcecode of 390respective directory. However, you might want to keep the package/source code of
373the latest version, just in case you want to reinstall the package (so you don't 391the latest version, just in case you want to reinstall the package (so you don't
374have to redownload it). 392have to redownload it).
375</p> 393</p>
376 394
377</body> 395</body>
391<pre caption="Building gnumeric"> 409<pre caption="Building gnumeric">
392# <i>emerge gnumeric</i> 410# <i>emerge gnumeric</i>
393</pre> 411</pre>
394 412
395<p> 413<p>
396This will download the sourcecode for you and unpacks, compiles and installs the 414This will download the source code for you and unpacks, compiles and installs
397package on your system. It will also do the same for all the dependencies. If 415the package on your system. It will also do the same for all the dependencies.
398you want to see what dependencies will be installed with it, use the 416If you want to see what dependencies will be installed with it, use the
399<c>--pretend</c> option (<c>-p</c> in short): 417<c>--pretend</c> option (<c>-p</c> in short):
400</p> 418</p>
401 419
402<pre caption="Pretending to build gnumeric"> 420<pre caption="Pretending to build gnumeric">
403# <i>emerge --pretend gnumeric</i> 421# <i>emerge --pretend gnumeric</i>
404</pre> 422</pre>
405 423
406<p> 424<p>
407If you want to download the sourcecode of the package and its dependencies, 425If you want to download the source code of the package and its dependencies,
408but don't want to build the package, use the <c>--fetchonly</c> option 426but don't want to build the package, use the <c>--fetchonly</c> option
409(<c>-f</c> in short): 427(<c>-f</c> in short):
410</p> 428</p>
411 429
412<pre caption="Fetching sources for gnumeric"> 430<pre caption="Fetching sources for gnumeric">
513<p> 531<p>
514Other possibilities are of course "&gt;" (later version) and "=" (the exact 532Other possibilities are of course "&gt;" (later version) and "=" (the exact
515version). 533version).
516</p> 534</p>
517 535
536
537</body>
538</subsection>
539<subsection>
540<title>Working with Dependencies</title>
541<body>
542
543<p>
544Portage has an extensive support for dependency handling. Although you usually
545don't need to even think about this (as dependencies are automatically handled
546by Portage) some users might want to know how you can work with <c>emerge</c>
547and dependencies.
548</p>
549
550<p>
551For instance, if you want Portage to pretend that none of the dependencies of a
552package are installed, you can use <c>--emptytree</c> (<c>-e</c> in short). This
553is useful with <c>--pretend</c> to display a complete tree of dependencies for
554any particular package. Without <c>--pretend</c>, <c>emerge</c> will (re)compile
555all listed packages. However, <c>glibc</c> will <e>not</e> be listed as
556dependency for safety reasons.
557</p>
558
559<pre caption="Show all dependencies of gnumeric">
560# <i>emerge --emptytree --pretend gnumeric</i>
561</pre>
562
563<p>
564Another argument is <c>--nodeps</c>, which will ask Portage to try install the
565given package without taking care of the dependencies. It is trivial that this
566can lead to failures.
567</p>
568
569<pre caption="Installing gnumeric without taking care of the dependencies">
570# <i>emerge --nodeps gnumeric</i>
571</pre>
572
573<p>
574The opposite of <c>--nodeps</c> is <c>--onlydeps</c>, which will have Portage
575install all dependencies of a given package, but not the package itself:
576</p>
577
578<pre caption="Installing the dependencies of gnumeric">
579# <i>emerge --onlydeps gnumeric</i>
580</pre>
518 581
519</body> 582</body>
520</subsection> 583</subsection>
521<subsection> 584<subsection>
522<title>Updating your System</title> 585<title>Updating your System</title>
585 </li> 648 </li>
586 <li> 649 <li>
587 <e>R</e> (reemerge) The package isn't new, but needs to be reemerged 650 <e>R</e> (reemerge) The package isn't new, but needs to be reemerged
588 </li> 651 </li>
589 <li> 652 <li>
590 <e>F</e> (fetch) The package requires that you download the sourcecode 653 <e>F</e> (fetch) The package requires that you download the source code
591 manually (for instance due to licencing issues) 654 manually (for instance due to licencing issues)
592 </li> 655 </li>
593 <li> 656 <li>
594 <e>U</e> (update) The package already exists on your system but will be 657 <e>U</e> (update) The package already exists on your system but will be
595 upgraded 658 upgraded
649Portage doesn't verify if a package is a dependency for another 712Portage doesn't verify if a package is a dependency for another
650installed package. It also doesn't warn you if the package is part of 713installed package. It also doesn't warn you if the package is part of
651<e>system</e>, i.e. a core application necessary for the correct functioning of 714<e>system</e>, i.e. a core application necessary for the correct functioning of
652your system! 715your system!
653</warn> 716</warn>
717
718<p>
719Once the unmerge begins you will see a long list of filenames belonging to the
720package. Some of these filenames will have a flag displayed to the
721left of the filename. The flags <c>!mtime</c>, <c>!empty</c>, and <c>cfgpro</c>
722specify reasons why certain files are not being removed while the package is.
723Files listed without any of these three flags are removed from the
724filesystem successfully. The three flags specify the following reasons:
725</p>
726
727<ul>
728 <li>
729 <c>!mtime</c> : The listed file has been changed since it was installed,
730 probably by you or some tool
731 </li>
732 <li>
733 <c>!empty</c> : The listed directory is not empty
734 </li>
735 <li>
736 <c>cfgpro</c> : This file is located inside a protected directory and will
737 not be touched for safety
738 </li>
739</ul>
654 740
655</body> 741</body>
656</subsection> 742</subsection>
657</section> 743</section>
658<section> 744<section>
735the same format as is used in <path>/usr/portage/profiles/package.mask</path>). 821the same format as is used in <path>/usr/portage/profiles/package.mask</path>).
736</p> 822</p>
737 823
738<p> 824<p>
739Do <e>not</e> alter the <path>/usr/portage/profiles/package.mask</path> file as 825Do <e>not</e> alter the <path>/usr/portage/profiles/package.mask</path> file as
740all changes are undone the next time you update your Portage tree. 826all changes are undone the next time you update your Portage tree. If you want
827to hardmask a package create <path>/etc/portage/package.mask</path> and list the
828package in it (use the same format as mentioned above).
741</p> 829</p>
742 830
743<p> 831<p>
744Another trick to circumvent the "masked package" problem is to install the 832Another trick to circumvent the "masked package" problem is to install the
745package using the full path. This will ignore both the <c>ACCEPT_KEYWORD</c> 833package using the full path. This will ignore both the <c>ACCEPT_KEYWORD</c>

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20