/[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.54 Revision 1.81
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- 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 -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.54 2005/06/11 12:16:14 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.81 2012/08/15 07:20:36 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract>
12This chapter explains the "simple" steps a user definitely needs to know to
13maintain the software on his system.
14</abstract>
15
11<version>1.49</version> 16<version>7</version>
12<date>2005-06-11</date> 17<date>2012-08-15</date>
13 18
14<section> 19<section>
15<title>Welcome to Portage</title> 20<title>Welcome to Portage</title>
16<body> 21<body>
17 22
85</p> 90</p>
86 91
87<pre caption="Running emerge-webrsync"> 92<pre caption="Running emerge-webrsync">
88# <i>emerge-webrsync</i> 93# <i>emerge-webrsync</i>
89</pre> 94</pre>
95
96<p>
97An additional advantage of using <c>emerge-webrsync</c> is that it allows the
98administrator to only pull in portage tree snapshots that are signed by the
99Gentoo release engineering GPG key. More information on this can be found
100in the <uri link="?part=2&amp;chap=3">Portage Features</uri> section on
101<uri link="?part=2&amp;chap=3#webrsync-gpg">Fetching Validated Portage Tree
102Snapshots</uri>.
103</p>
90 104
91</body> 105</body>
92</subsection> 106</subsection>
93</section> 107</section>
94<section> 108<section>
191</p> 205</p>
192 206
193<pre caption="Checking the existence of a doc USE flag"> 207<pre caption="Checking the existence of a doc USE flag">
194<comment>(alsa-lib is just an example, of course.)</comment> 208<comment>(alsa-lib is just an example, of course.)</comment>
195# <i>emerge -vp alsa-lib</i> 209# <i>emerge -vp alsa-lib</i>
196[ebuild N ] media-libs/alsa-lib-1.0.9_rc3 +doc -jack 674 kB 210[ebuild N ] media-libs/alsa-lib-1.0.14_rc1 -debug +doc 698 kB
197</pre> 211</pre>
198 212
199<p> 213<p>
200You can enable or disable the <c>doc</c> USE flag either globally in the 214The best way of enabling the <c>doc</c> USE flag is doing it on a per-package
201<path>/etc/make.conf</path> file or per package in the 215basis via <path>/etc/portage/package.use</path>, so that you get documentation
202<path>/etc/portage/package.use</path> file. The <uri 216only for packages that you are interested in. Enabling this flag globally is
203link="?part=2&amp;chap=2">USE Flags</uri> chapter covers this aspect in detail. 217known to cause problems with circular dependencies. For more information, please
218read the <uri link="?part=2&amp;chap=2">USE Flags</uri> chapter.
204</p> 219</p>
205 220
206<p> 221<p>
207Once the package installed, its documentation is generally found in a 222Once the package installed, its documentation is generally found in a
208subdirectory named after the package under the <path>/usr/share/doc</path> 223subdirectory named after the package under the <path>/usr/share/doc</path>
210which is part of the <c>app-portage/gentoolkit</c> <uri 225which is part of the <c>app-portage/gentoolkit</c> <uri
211link="/doc/en/gentoolkit.xml">package</uri>. 226link="/doc/en/gentoolkit.xml">package</uri>.
212</p> 227</p>
213 228
214<pre caption="Locating package documentation"> 229<pre caption="Locating package documentation">
215# <i>ls -l /usr/share/doc/alsa-lib-1.0.9_rc3</i> 230# <i>ls -l /usr/share/doc/alsa-lib-1.0.14_rc1</i>
216total 28 231total 28
217-rw-r--r-- 1 root root 669 May 17 21:54 ChangeLog.gz 232-rw-r--r-- 1 root root 669 May 17 21:54 ChangeLog.gz
218-rw-r--r-- 1 root root 9373 May 17 21:54 COPYING.gz 233-rw-r--r-- 1 root root 9373 May 17 21:54 COPYING.gz
219drwxr-xr-x 2 root root 8560 May 17 21:54 html 234drwxr-xr-x 2 root root 8560 May 17 21:54 html
220-rw-r--r-- 1 root root 196 May 17 21:54 TODO.gz 235-rw-r--r-- 1 root root 196 May 17 21:54 TODO.gz
221 236
222<comment>(Alternatively, use equery to locate interesting files:)</comment> 237<comment>(Alternatively, use equery to locate interesting files:)</comment>
223# <i>equery files alsa-lib | less</i> 238# <i>equery files alsa-lib | less</i>
224media-libs/alsa-lib-1.0.9_rc3 239media-libs/alsa-lib-1.0.14_rc1
225* Contents of media-libs/alsa-lib-1.0.9_rc3: 240* Contents of media-libs/alsa-lib-1.0.14_rc1:
226/usr 241/usr
227/usr/bin 242/usr/bin
228/usr/bin/alsalisp 243/usr/bin/alsalisp
229<comment>(Output truncated)</comment> 244<comment>(Output truncated)</comment>
230</pre> 245</pre>
272<p> 287<p>
273To keep your system in perfect shape (and not to mention install the latest 288To keep your system in perfect shape (and not to mention install the latest
274security updates) you need to update your system regularly. Since Portage only 289security updates) you need to update your system regularly. Since Portage only
275checks the ebuilds in your Portage tree you first have to update your Portage 290checks the ebuilds in your Portage tree you first have to update your Portage
276tree. When your Portage tree is updated, you can update your system with 291tree. When your Portage tree is updated, you can update your system with
277<c>emerge --update world</c>: 292<c>emerge --update world</c>. In the next example, we'll also use the
293<c>--ask</c> switch which will tell Portage to display the list of packages it
294wants to upgrade and ask you if you want to continue:
278</p> 295</p>
279 296
280<pre caption="Updating your system"> 297<pre caption="Updating your system">
281# <i>emerge --update world</i> 298# <i>emerge --update --ask world</i>
282</pre> 299</pre>
283 300
284<p> 301<p>
285Portage will then search for newer version of the applications you have 302Portage will then search for newer version of the applications you have
286installed. However, it will only verify the versions for the applications you 303installed. However, it will only verify the versions for the applications you
287have explicitly installed - not the dependencies. If you want to update every 304have <e>explicitly</e> installed (the applications listed in
288single package on your system, add the <c>--deep</c> argument: 305<path>/var/lib/portage/world</path>) - it does not thoroughly check their
306dependencies. If you want to update the dependencies of those packages as well,
307add the <c>--deep</c> argument:
308</p>
309
310<pre caption="Updating your system with dependencies">
311# <i>emerge --update --deep world</i>
312</pre>
313
314<p>
315Still, this doesn't mean <e>all packages</e>: some packages on your system are
316needed during the compile and build process of packages, but once that package
317is installed, these dependencies are no longer required. Portage calls those
318<e>build dependencies</e>. To include those in an update cycle, add
319<c>--with-bdeps=y</c>:
289</p> 320</p>
290 321
291<pre caption="Updating your entire system"> 322<pre caption="Updating your entire system">
292# <i>emerge --update --deep world</i> 323# <i>emerge --update --deep --with-bdeps=y world</i>
293</pre> 324</pre>
294 325
295<p> 326<p>
296Since security updates also happen in packages you have not explicitly installed 327Since security updates also happen in packages you have not explicitly installed
297on your system (but that are pulled in as dependencies of other programs), it 328on your system (but that are pulled in as dependencies of other programs), it
304if the change requires the installation of new packages or recompilation of 335if the change requires the installation of new packages or recompilation of
305existing ones: 336existing ones:
306</p> 337</p>
307 338
308<pre caption="Performing a full update"> 339<pre caption="Performing a full update">
309# <i>emerge --update --deep --newuse world</i> 340# <i>emerge --update --deep --with-bdeps=y --newuse world</i>
310</pre> 341</pre>
311 342
312</body> 343</body>
313</subsection> 344</subsection>
314<subsection> 345<subsection>
315<title>Metapackages</title> 346<title>Metapackages</title>
316<body> 347<body>
317 348
318<p> 349<p>
319Some packages in the Portage tree don't have any real content but are used to 350Some packages in the Portage tree don't have any real content but are used to
320install a collection of packages. For instance, the <c>kde</c> package will 351install a collection of packages. For instance, the <c>kde-meta</c> package will
321install a complete KDE environment on your system by pulling in various 352install a complete KDE environment on your system by pulling in various
322KDE-related packages as dependencies. 353KDE-related packages as dependencies.
323</p> 354</p>
324 355
325<p> 356<p>
358</pre> 389</pre>
359 390
360</body> 391</body>
361</subsection> 392</subsection>
362</section> 393</section>
394<section id="license">
395<title>Licenses</title>
396<subsection>
397<body>
398
399<p>
400Beginning with Portage version 2.1.7, you can accept or reject software
401installation based on its license. All packages in the tree contain a
402<c>LICENSE</c> entry in their ebuilds. Running <c>emerge --search
403packagename</c> will tell you the package's license.
404</p>
405
406<p>
407By default, Portage permits all licenses, except End User License Agreements
408(EULAs) that require reading and signing an acceptance agreement.
409</p>
410
411<p>
412The variable that controls permitted licenses is <c>ACCEPT_LICENSE</c>, which
413can be set in <path>/etc/portage/make.conf</path>:
414</p>
415
416<pre caption="Default ACCEPT_LICENSE in /etc/portage/make.conf">
417ACCEPT_LICENSE="* -@EULA"
418</pre>
419
420<p>
421With this configuration, packages that require interaction during installation
422to approve their EULA <e>will not</e> be installed. Packages without an EULA
423<e>will</e> be installed.
424</p>
425
426<p>
427You can set <c>ACCEPT_LICENSE</c> globally in <path>/etc/portage/make.conf</path>
428, or you can specify it on a per-package basis in
429<path>/etc/portage/package.license</path>.
430</p>
431
432<p>
433For example, if you want to allow the <c>truecrypt-2.7</c> license for
434<c>app-crypt/truecrypt</c>, add the following to
435<path>/etc/portage/package.license</path>:
436</p>
437
438<pre caption="Specifying a truecrypt license in package.license">
439app-crypt/truecrypt truecrypt-2.7
440</pre>
441
442<p>
443This permits installation of truecrypt versions that have the
444<c>truecrypt-2.7</c> license, but not versions with the <c>truecrypt-2.8</c>
445license.
446</p>
447
448<impo>
449Licenses are stored in <path>/usr/portage/licenses</path>, and license groups
450are kept in <path>/usr/portage/profiles/license_groups</path>. The first entry
451of each line in CAPITAL letters is the name of the license group, and every
452entry after that is an individual license.
453</impo>
454
455<p>
456License groups defined in <c>ACCEPT_LICENSE</c> are prefixed with an <b>@</b>
457sign. Here's an example of a system that globally permits the GPL-compatible
458license group, as well as a few other groups and individual licenses:
459</p>
460
461<pre caption="ACCEPT_LICENSE in /etc/portage/make.conf">
462ACCEPT_LICENSE="@GPL-COMPATIBLE @OSI-APPROVED @EULA atheros-hal BitstreamVera"
463</pre>
464
465<p>
466If you want only free software and documentation on your system, you might use
467the following setup:
468</p>
469
470<pre caption="Use only free licenses">
471ACCEPT_LICENSE="-* @FREE"
472</pre>
473
474<p>
475In this case, "free" is mostly defined by the <uri
476link="http://www.gnu.org/philosophy/free-sw.html">FSF</uri> and <uri
477link="http://www.opensource.org/docs/osd">OSI</uri>. Any package whose license
478does not meet these requirements will not be installed on your system.
479</p>
480
481</body>
482</subsection>
483</section>
363<section> 484<section>
364<title>When Portage is Complaining...</title> 485<title>When Portage is Complaining...</title>
365<subsection> 486<subsection>
366<title>About SLOTs, Virtuals, Branches, Architectures and Profiles</title> 487<title>About SLOTs, Virtuals, Branches, Architectures and Profiles</title>
367<body> 488<body>
385There are also packages that provide the same functionality but are implemented 506There are also packages that provide the same functionality but are implemented
386differently. For instance, <c>metalogd</c>, <c>sysklogd</c> and <c>syslog-ng</c> 507differently. For instance, <c>metalogd</c>, <c>sysklogd</c> and <c>syslog-ng</c>
387are all system loggers. Applications that rely on the availability of "a system 508are all system loggers. Applications that rely on the availability of "a system
388logger" cannot depend on, for instance, <c>metalogd</c>, as the other system 509logger" cannot depend on, for instance, <c>metalogd</c>, as the other system
389loggers are as good a choice as any. Portage allows for <e>virtuals</e>: each 510loggers are as good a choice as any. Portage allows for <e>virtuals</e>: each
390system logger provides <c>virtual/syslog</c> so that applications can depend on 511system logger is listed as an "exclusive" dependency of the logging service in the
391<c>virtual/syslog</c>. 512<c>logger</c> virtual package of the <c>virtual</c> category, so that
513applications can depend on the <c>virtual/logger</c> package. When installed,
514the package will pull in the first logging package mentioned in the package,
515unless a logging package was already installed (in which case the virtual is
516satisfied).
392</p> 517</p>
393 518
394<p> 519<p>
395Software in the Portage tree can reside in different branches. By default your 520Software in the Portage tree can reside in different branches. By default your
396system only accepts packages that Gentoo deems stable. Most new software titles, 521system only accepts packages that Gentoo deems stable. Most new software titles,
418<subsection id="blocked"> 543<subsection id="blocked">
419<title>Blocked Packages</title> 544<title>Blocked Packages</title>
420<body> 545<body>
421 546
422<pre caption="Portage warning about blocked packages (with --pretend)"> 547<pre caption="Portage warning about blocked packages (with --pretend)">
423[blocks B ] gnome-base/bonobo-activation (from pkg gnome-base/libbonobo-2.4.0) 548[blocks B ] mail-mta/ssmtp (is blocking mail-mta/postfix-2.2.2-r1)
424</pre> 549</pre>
425 550
426<pre caption="Portage warning about blocked packages (without --pretend)"> 551<pre caption="Portage warning about blocked packages (without --pretend)">
427!!! Error: the gnome-base/bonobo-activation package conflicts with another package. 552!!! Error: the mail-mta/postfix package conflicts with another package.
428!!! both can't be installed on the same system together. 553!!! both can't be installed on the same system together.
429!!! Please use 'emerge --pretend' to determine blockers. 554!!! Please use 'emerge --pretend' to determine blockers.
430</pre> 555</pre>
431 556
432<p> 557<p>
436these dependencies explicitly marks a package or virtual as being <e>not</e> 561these dependencies explicitly marks a package or virtual as being <e>not</e>
437compatible, it triggers a blockage. 562compatible, it triggers a blockage.
438</p> 563</p>
439 564
440<p> 565<p>
566While recent versions of Portage are smart enough to work around minor blockages
567without user intervention, occasionally you will need to fix it yourself, as
568explained below.
569</p>
570
571<p>
441To fix a blockage, you can choose to not install the package or unmerge the 572To fix a blockage, you can choose to not install the package or unmerge the
442conflicting package first. In the given example, you can opt not to install 573conflicting package first. In the given example, you can opt not to install
443<c>libbonobo</c> or to remove <c>bonobo-activation</c> first. 574<c>postfix</c> or to remove <c>ssmtp</c> first.
575</p>
576
577<p>
578You may also see blocking packages with specific atoms, such as
579<b>&lt;</b>media-video/mplayer-1.0_rc1-r2. In this case, updating to a more
580recent version of the blocking package would remove the block.
581</p>
582
583<p>
584It is also possible that two packages that are yet to be installed are blocking
585each other. In this rare case, you should find out why you need to install both.
586In most cases you can do with one of the packages alone. If not, please file a
587bug on <uri link="http://bugs.gentoo.org">Gentoo's bugtracking system</uri>.
444</p> 588</p>
445 589
446</body> 590</body>
447</subsection> 591</subsection>
448<subsection id="masked"> 592<subsection id="masked">
458 602
459- gnome-base/gnome-2.8.0_pre1 (masked by: <i>~x86 keyword</i>) 603- gnome-base/gnome-2.8.0_pre1 (masked by: <i>~x86 keyword</i>)
460- lm-sensors/lm-sensors-2.8.7 (masked by: <i>-sparc keyword</i>) 604- lm-sensors/lm-sensors-2.8.7 (masked by: <i>-sparc keyword</i>)
461- sys-libs/glibc-2.3.4.20040808 (masked by: <i>-* keyword</i>) 605- sys-libs/glibc-2.3.4.20040808 (masked by: <i>-* keyword</i>)
462- dev-util/cvsd-1.0.2 (masked by: <i>missing keyword</i>) 606- dev-util/cvsd-1.0.2 (masked by: <i>missing keyword</i>)
463- media-video/ati-gatos-4.3.0 (masked by: <i>package.mask</i>) 607- games-fps/unreal-tournament-451 (masked by: <i>package.mask</i>)
464- sys-libs/glibc-2.3.2-r11 (masked by: <i>profile</i>) 608- sys-libs/glibc-2.3.2-r11 (masked by: <i>profile</i>)
609- net-im/skype-2.1.0.81 (masked by: skype-eula <i>license</i>(s))
465</pre> 610</pre>
466 611
467<p> 612<p>
468When you want to install a package that isn't available for your system, you 613When you want to install a package that isn't available for your system, you
469will receive this masking error. You should try installing a different 614will receive this masking error. You should try installing a different
494 <li> 639 <li>
495 <b>profile</b> means that the package has been found not suitable for your 640 <b>profile</b> means that the package has been found not suitable for your
496 profile. The application might break your system if you installed it or is 641 profile. The application might break your system if you installed it or is
497 just not compatible with the profile you use. 642 just not compatible with the profile you use.
498 </li> 643 </li>
644 <li>
645 <b>license</b> means that the package's license is not compatible with your
646 <c>ACCEPT_LICENSE</c> setting. You must explicitly permit its license or
647 license group by setting it in <path>/etc/portage/make.conf</path> or in
648 <path>/etc/portage/package.license</path>. Refer to <uri
649 link="#license">Licenses</uri> to learn how licenses work.
650 </li>
499</ul> 651</ul>
652
653</body>
654</subsection>
655<subsection id="USEdependency">
656<title>Necessary USE Flag Changes</title>
657<body>
658
659<pre caption="Portage warning about USE flag change requirement">
660The following USE changes are necessary to proceed:
661#required by app-text/happypackage-2.0, required by happypackage (argument)
662>=app-text/feelings-1.0.0 test
663</pre>
664
665<p>
666The error message might also be displayed as follows, if <c>--autounmask</c>
667isn't set:
668</p>
669
670<pre caption="Portage error about USE flag change requirement">
671emerge: there are no ebuilds built with USE flags to satisfy "app-text/feelings[test]".
672!!! One of the following packages is required to complete your request:
673- app-text/feelings-1.0.0 (Change USE: +test)
674(dependency required by "app-text/happypackage-2.0" [ebuild])
675(dependency required by "happypackage" [argument])
676</pre>
677
678<p>
679Such warning or error occurs when you want to install a package which not only
680depends on another package, but also requires that that package is built with a
681particular USE flag (or set of USE flags). In the given example, the package
682<c>app-text/feelings</c> needs to be built with <c>USE="test"</c>, but this USE
683flag is not set on the system.
684</p>
685
686<p>
687To resolve this, either add the requested USE flag to your global USE flags in
688<path>/etc/portage/make.conf</path>, or set it for the specific package in
689<path>/etc/portage/package.use</path>.
690</p>
500 691
501</body> 692</body>
502</subsection> 693</subsection>
503<subsection id="missingdependencies"> 694<subsection id="missingdependencies">
504<title>Missing Dependencies</title> 695<title>Missing Dependencies</title>
524<subsection id="ambiguousebuild"> 715<subsection id="ambiguousebuild">
525<title>Ambiguous Ebuild Name</title> 716<title>Ambiguous Ebuild Name</title>
526<body> 717<body>
527 718
528<pre caption="Portage warning about ambiguous ebuild names"> 719<pre caption="Portage warning about ambiguous ebuild names">
720[ Results for search key : listen ]
721[ Applications found : 2 ]
722
723* dev-tinyos/listen [ Masked ]
724 Latest version available: 1.1.15
725 Latest version installed: [ Not Installed ]
726 Size of files: 10,032 kB
727 Homepage: http://www.tinyos.net/
728 Description: Raw listen for TinyOS
729 License: BSD
730
731* media-sound/listen [ Masked ]
732 Latest version available: 0.6.3
733 Latest version installed: [ Not Installed ]
734 Size of files: 859 kB
735 Homepage: http://www.listen-project.org
736 Description: A Music player and management for GNOME
737 License: GPL-2
738
529!!! The short ebuild name "aterm" is ambiguous. Please specify 739!!! The short ebuild name "listen" is ambiguous. Please specify
530!!! one of the following fully-qualified ebuild names instead: 740!!! one of the above fully-qualified ebuild names instead.
531
532 dev-libs/aterm
533 x11-terms/aterm
534</pre> 741</pre>
535 742
536<p> 743<p>
537The application you want to install has a name that corresponds with more than 744The application you want to install has a name that corresponds with more than
538one package. You need to supply the category name as well. Portage will inform 745one package. You need to supply the category name as well. Portage will inform
601from the system. 808from the system.
602</p> 809</p>
603 810
604</body> 811</body>
605</subsection> 812</subsection>
813<subsection id="digesterror">
814<title>Digest Verification Failures</title>
815<body>
816
817<p>
818Sometimes, when you attempt to emerge a package, it will fail with the message:
819</p>
820
821<pre caption="Digest verification failure">
822&gt;&gt;&gt; checking ebuild checksums
823!!! Digest verification failed:
824</pre>
825
826<p>
827This is a sign that something is wrong with the Portage tree -- often, it is
828because a developer may have made a mistake when committing a package to the
829tree.
830</p>
831
832<p>
833When the digest verification fails, do <e>not</e> try to re-digest the package
834yourself. Running <c>ebuild foo manifest</c> will not fix the problem; it will
835almost certainly make it worse!
836</p>
837
838<p>
839Instead, wait an hour or two for the tree to settle down. It's likely that the
840error was noticed right away, but it can take a little time for the fix to
841trickle down the Portage tree. While you're waiting, check <uri
842link="http://bugs.gentoo.org">Bugzilla</uri> and see if anyone has reported
843the problem yet. If not, go ahead and file a bug for the broken package.
844</p>
845
846<p>
847Once you see that the bug has been fixed, you may want to re-sync to pick up
848the fixed digest.
849</p>
850
851<impo>
852This does <e>not</e> mean that you can re-sync your tree multiple times! As
853stated in the rsync policy (when you run <c>emerge --sync</c>), users who sync
854too often will be banned! In fact, it's better to just wait until your next
855scheduled sync, so that you don't overload the rsync servers.
856</impo>
857
858</body>
859</subsection>
606</section> 860</section>
607</sections> 861</sections>

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.81

  ViewVC Help
Powered by ViewVC 1.1.20