/[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.51 Revision 1.78
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.51 2005/05/17 14:39:26 neysx Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.78 2011/10/26 19:46:19 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.46</version> 16<version>4</version>
12<date>2005-05-17</date> 17<date>2011-10-26</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>
178</pre> 192</pre>
179 193
180</body> 194</body>
181</subsection> 195</subsection>
182<subsection> 196<subsection>
197<title>Finding Installed Package Documentation</title>
198<body>
199
200<p>
201Many packages come with their own documentation. Sometimes, the <c>doc</c> USE
202flag determines whether the package documentation should be installed or not.
203You can check the existence of a <c>doc</c> USE flag with the <c>emerge -vp
204&lt;package name&gt;</c> command.
205</p>
206
207<pre caption="Checking the existence of a doc USE flag">
208<comment>(alsa-lib is just an example, of course.)</comment>
209# <i>emerge -vp alsa-lib</i>
210[ebuild N ] media-libs/alsa-lib-1.0.14_rc1 -debug +doc 698 kB
211</pre>
212
213<p>
214The best way of enabling the <c>doc</c> USE flag is doing it on a per-package
215basis via <path>/etc/portage/package.use</path>, so that you get documentation
216only for packages that you are interested in. Enabling this flag globally is
217known to cause problems with circular dependencies. For more information, please
218read the <uri link="?part=2&amp;chap=2">USE Flags</uri> chapter.
219</p>
220
221<p>
222Once the package installed, its documentation is generally found in a
223subdirectory named after the package under the <path>/usr/share/doc</path>
224directory. You can also list all installed files with the <c>equery</c> tool
225which is part of the <c>app-portage/gentoolkit</c> <uri
226link="/doc/en/gentoolkit.xml">package</uri>.
227</p>
228
229<pre caption="Locating package documentation">
230# <i>ls -l /usr/share/doc/alsa-lib-1.0.14_rc1</i>
231total 28
232-rw-r--r-- 1 root root 669 May 17 21:54 ChangeLog.gz
233-rw-r--r-- 1 root root 9373 May 17 21:54 COPYING.gz
234drwxr-xr-x 2 root root 8560 May 17 21:54 html
235-rw-r--r-- 1 root root 196 May 17 21:54 TODO.gz
236
237<comment>(Alternatively, use equery to locate interesting files:)</comment>
238# <i>equery files alsa-lib | less</i>
239media-libs/alsa-lib-1.0.14_rc1
240* Contents of media-libs/alsa-lib-1.0.14_rc1:
241/usr
242/usr/bin
243/usr/bin/alsalisp
244<comment>(Output truncated)</comment>
245</pre>
246
247</body>
248</subsection>
249<subsection>
183<title>Removing Software</title> 250<title>Removing Software</title>
184<body> 251<body>
185 252
186<p> 253<p>
187When you want to remove a software package from your system, use <c>emerge 254When you want to remove a software package from your system, use <c>emerge
220<p> 287<p>
221To 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
222security updates) you need to update your system regularly. Since Portage only 289security updates) you need to update your system regularly. Since Portage only
223checks 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
224tree. 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
225<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:
226</p> 295</p>
227 296
228<pre caption="Updating your system"> 297<pre caption="Updating your system">
229# <i>emerge --update world</i> 298# <i>emerge --update --ask world</i>
230</pre> 299</pre>
231 300
232<p> 301<p>
233Portage will then search for newer version of the applications you have 302Portage will then search for newer version of the applications you have
234installed. However, it will only verify the versions for the applications you 303installed. However, it will only verify the versions for the applications you
235have explicitly installed - not the dependencies. If you want to update every 304have <e>explicitly</e> installed (the applications listed in
236single 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>:
237</p> 320</p>
238 321
239<pre caption="Updating your entire system"> 322<pre caption="Updating your entire system">
240# <i>emerge --update --deep world</i> 323# <i>emerge --update --deep --with-bdeps=y world</i>
324</pre>
325
326<p>
327Since security updates also happen in packages you have not explicitly installed
328on your system (but that are pulled in as dependencies of other programs), it
329is recommended to run this command once in a while.
241</pre> 330</p>
242 331
243<p> 332<p>
244If you have altered any of your <uri link="?part=2&amp;chap=2">USE flags</uri> 333If you have altered any of your <uri link="?part=2&amp;chap=2">USE flags</uri>
245lately you might want to add <c>--newuse</c> as well. Portage will then verify 334lately you might want to add <c>--newuse</c> as well. Portage will then verify
246if the change requires the installation of new packages or recompilation of 335if the change requires the installation of new packages or recompilation of
247existing ones: 336existing ones:
248</p> 337</p>
249 338
250<pre caption="Performing a full update"> 339<pre caption="Performing a full update">
251# <i>emerge --update --deep --newuse world</i> 340# <i>emerge --update --deep --with-bdeps=y --newuse world</i>
252</pre> 341</pre>
253 342
254</body> 343</body>
255</subsection> 344</subsection>
256<subsection> 345<subsection>
257<title>Metapackages</title> 346<title>Metapackages</title>
258<body> 347<body>
259 348
260<p> 349<p>
261Some 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
262install 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
263install a complete KDE environment on your system by pulling in various 352install a complete KDE environment on your system by pulling in various
264KDE-related packages as dependencies. 353KDE-related packages as dependencies.
265</p> 354</p>
266 355
267<p> 356<p>
300</pre> 389</pre>
301 390
302</body> 391</body>
303</subsection> 392</subsection>
304</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/make.conf</path>:
414</p>
415
416<pre caption="Default ACCEPT_LICENSE in /etc/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/make.conf</path>, or
428you 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/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>
305<section> 484<section>
306<title>When Portage is Complaining...</title> 485<title>When Portage is Complaining...</title>
307<subsection> 486<subsection>
308<title>About SLOTs, Virtuals, Branches, Architectures and Profiles</title> 487<title>About SLOTs, Virtuals, Branches, Architectures and Profiles</title>
309<body> 488<body>
360<subsection id="blocked"> 539<subsection id="blocked">
361<title>Blocked Packages</title> 540<title>Blocked Packages</title>
362<body> 541<body>
363 542
364<pre caption="Portage warning about blocked packages (with --pretend)"> 543<pre caption="Portage warning about blocked packages (with --pretend)">
365[blocks B ] gnome-base/bonobo-activation (from pkg gnome-base/libbonobo-2.4.0) 544[blocks B ] mail-mta/ssmtp (is blocking mail-mta/postfix-2.2.2-r1)
366</pre> 545</pre>
367 546
368<pre caption="Portage warning about blocked packages (without --pretend)"> 547<pre caption="Portage warning about blocked packages (without --pretend)">
369!!! Error: the gnome-base/bonobo-activation package conflicts with another package. 548!!! Error: the mail-mta/postfix package conflicts with another package.
370!!! both can't be installed on the same system together. 549!!! both can't be installed on the same system together.
371!!! Please use 'emerge --pretend' to determine blockers. 550!!! Please use 'emerge --pretend' to determine blockers.
372</pre> 551</pre>
373 552
374<p> 553<p>
378these dependencies explicitly marks a package or virtual as being <e>not</e> 557these dependencies explicitly marks a package or virtual as being <e>not</e>
379compatible, it triggers a blockage. 558compatible, it triggers a blockage.
380</p> 559</p>
381 560
382<p> 561<p>
562While recent versions of Portage are smart enough to work around minor blockages
563without user intervention, occasionally you will need to fix it yourself, as
564explained below.
565</p>
566
567<p>
383To fix a blockage, you can choose to not install the package or unmerge the 568To fix a blockage, you can choose to not install the package or unmerge the
384conflicting package first. In the given example, you can opt not to install 569conflicting package first. In the given example, you can opt not to install
385<c>libbonobo</c> or to remove <c>bonobo-activation</c> first. 570<c>postfix</c> or to remove <c>ssmtp</c> first.
571</p>
572
573<p>
574You may also see blocking packages with specific atoms, such as
575<b>&lt;</b>media-video/mplayer-1.0_rc1-r2. In this case, updating to a more
576recent version of the blocking package would remove the block.
577</p>
578
579<p>
580It is also possible that two packages that are yet to be installed are blocking
581each other. In this rare case, you should find out why you need to install both.
582In most cases you can do with one of the packages alone. If not, please file a
583bug on <uri link="http://bugs.gentoo.org">Gentoo's bugtracking system</uri>.
386</p> 584</p>
387 585
388</body> 586</body>
389</subsection> 587</subsection>
390<subsection id="masked"> 588<subsection id="masked">
400 598
401- gnome-base/gnome-2.8.0_pre1 (masked by: <i>~x86 keyword</i>) 599- gnome-base/gnome-2.8.0_pre1 (masked by: <i>~x86 keyword</i>)
402- lm-sensors/lm-sensors-2.8.7 (masked by: <i>-sparc keyword</i>) 600- lm-sensors/lm-sensors-2.8.7 (masked by: <i>-sparc keyword</i>)
403- sys-libs/glibc-2.3.4.20040808 (masked by: <i>-* keyword</i>) 601- sys-libs/glibc-2.3.4.20040808 (masked by: <i>-* keyword</i>)
404- dev-util/cvsd-1.0.2 (masked by: <i>missing keyword</i>) 602- dev-util/cvsd-1.0.2 (masked by: <i>missing keyword</i>)
405- media-video/ati-gatos-4.3.0 (masked by: <i>package.mask</i>) 603- games-fps/unreal-tournament-451 (masked by: <i>package.mask</i>)
406- sys-libs/glibc-2.3.2-r11 (masked by: <i>profile</i>) 604- sys-libs/glibc-2.3.2-r11 (masked by: <i>profile</i>)
605- net-im/skype-2.1.0.81 (masked by: skype-eula <i>license</i>(s))
407</pre> 606</pre>
408 607
409<p> 608<p>
410When you want to install a package that isn't available for your system, you 609When you want to install a package that isn't available for your system, you
411will receive this masking error. You should try installing a different 610will receive this masking error. You should try installing a different
436 <li> 635 <li>
437 <b>profile</b> means that the package has been found not suitable for your 636 <b>profile</b> means that the package has been found not suitable for your
438 profile. The application might break your system if you installed it or is 637 profile. The application might break your system if you installed it or is
439 just not compatible with the profile you use. 638 just not compatible with the profile you use.
440 </li> 639 </li>
640 <li>
641 <b>license</b> means that the package's license is not compatible with your
642 <c>ACCEPT_LICENSE</c> setting. You must explicitly permit its license or
643 license group by setting it in <path>/etc/make.conf</path> or in
644 <path>/etc/portage/package.license</path>. Refer to <uri
645 link="#license">Licenses</uri> to learn how licenses work.
646 </li>
441</ul> 647</ul>
648
649</body>
650</subsection>
651<subsection id="USEdependency">
652<title>Necessary USE Flag Changes</title>
653<body>
654
655<pre caption="Portage warning about USE flag change requirement">
656The following USE changes are necessary to proceed:
657#required by app-text/happypackage-2.0, required by happypackage (argument)
658>=app-text/feelings-1.0.0 test
659</pre>
660
661<p>
662The error message might also be displayed as follows, if <c>--autounmask</c>
663isn't set:
664</p>
665
666<pre caption="Portage error about USE flag change requirement">
667emerge: there are no ebuilds built with USE flags to satisfy "app-text/feelings[test]".
668!!! One of the following packages is required to complete your request:
669- app-text/feelings-1.0.0 (Change USE: +test)
670(dependency required by "app-text/happypackage-2.0" [ebuild])
671(dependency required by "happypackage" [argument])
672</pre>
673
674<p>
675Such warning or error occurs when you want to install a package which not only
676depends on another package, but also requires that that package is built with a
677particular USE flag (or set of USE flags). In the given example, the package
678<c>app-text/feelings</c> needs to be built with <c>USE="test"</c>, but this USE
679flag is not set on the system.
680</p>
681
682<p>
683To resolve this, either add the requested USE flag to your global USE flags in
684<path>/etc/make.conf</path>, or set it for the specific package in
685<path>/etc/portage/package.use</path>.
686</p>
442 687
443</body> 688</body>
444</subsection> 689</subsection>
445<subsection id="missingdependencies"> 690<subsection id="missingdependencies">
446<title>Missing Dependencies</title> 691<title>Missing Dependencies</title>
466<subsection id="ambiguousebuild"> 711<subsection id="ambiguousebuild">
467<title>Ambiguous Ebuild Name</title> 712<title>Ambiguous Ebuild Name</title>
468<body> 713<body>
469 714
470<pre caption="Portage warning about ambiguous ebuild names"> 715<pre caption="Portage warning about ambiguous ebuild names">
716[ Results for search key : listen ]
717[ Applications found : 2 ]
718
719* dev-tinyos/listen [ Masked ]
720 Latest version available: 1.1.15
721 Latest version installed: [ Not Installed ]
722 Size of files: 10,032 kB
723 Homepage: http://www.tinyos.net/
724 Description: Raw listen for TinyOS
725 License: BSD
726
727* media-sound/listen [ Masked ]
728 Latest version available: 0.6.3
729 Latest version installed: [ Not Installed ]
730 Size of files: 859 kB
731 Homepage: http://www.listen-project.org
732 Description: A Music player and management for GNOME
733 License: GPL-2
734
471!!! The short ebuild name "aterm" is ambiguous. Please specify 735!!! The short ebuild name "listen" is ambiguous. Please specify
472!!! one of the following fully-qualified ebuild names instead: 736!!! one of the above fully-qualified ebuild names instead.
473
474 dev-libs/aterm
475 x11-terms/aterm
476</pre> 737</pre>
477 738
478<p> 739<p>
479The application you want to install has a name that corresponds with more than 740The application you want to install has a name that corresponds with more than
480one package. You need to supply the category name as well. Portage will inform 741one package. You need to supply the category name as well. Portage will inform
543from the system. 804from the system.
544</p> 805</p>
545 806
546</body> 807</body>
547</subsection> 808</subsection>
809<subsection id="digesterror">
810<title>Digest Verification Failures</title>
811<body>
812
813<p>
814Sometimes, when you attempt to emerge a package, it will fail with the message:
815</p>
816
817<pre caption="Digest verification failure">
818&gt;&gt;&gt; checking ebuild checksums
819!!! Digest verification failed:
820</pre>
821
822<p>
823This is a sign that something is wrong with the Portage tree -- often, it is
824because a developer may have made a mistake when committing a package to the
825tree.
826</p>
827
828<p>
829When the digest verification fails, do <e>not</e> try to re-digest the package
830yourself. Running <c>ebuild foo manifest</c> will not fix the problem; it will
831almost certainly make it worse!
832</p>
833
834<p>
835Instead, wait an hour or two for the tree to settle down. It's likely that the
836error was noticed right away, but it can take a little time for the fix to
837trickle down the Portage tree. While you're waiting, check <uri
838link="http://bugs.gentoo.org">Bugzilla</uri> and see if anyone has reported
839the problem yet. If not, go ahead and file a bug for the broken package.
840</p>
841
842<p>
843Once you see that the bug has been fixed, you may want to re-sync to pick up
844the fixed digest.
845</p>
846
847<impo>
848This does <e>not</e> mean that you can re-sync your tree multiple times! As
849stated in the rsync policy (when you run <c>emerge --sync</c>), users who sync
850too often will be banned! In fact, it's better to just wait until your next
851scheduled sync, so that you don't overload the rsync servers.
852</impo>
853
854</body>
855</subsection>
548</section> 856</section>
549</sections> 857</sections>

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.78

  ViewVC Help
Powered by ViewVC 1.1.20