/[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.40 Revision 1.63
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.40 2004/10/21 16:34:46 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.63 2007/03/25 23:58:47 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
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
16<version>1.57</version>
17<date>2007-03-25</date>
18
10<section> 19<section>
11<title>Welcome to Portage</title> 20<title>Welcome to Portage</title>
12<body> 21<body>
13 22
14<p> 23<p>
62<title>Updating the Portage Tree</title> 71<title>Updating the Portage Tree</title>
63<body> 72<body>
64 73
65<p> 74<p>
66The Portage tree is usually updated with <uri 75The Portage tree is usually updated with <uri
67link="http://rsync.gentoo.org">rsync</uri>, a fast incremental file transfer 76link="http://rsync.samba.org/">rsync</uri>, a fast incremental file transfer
68utility. Updating is fairly simple as the <c>emerge</c> command provides a 77utility. Updating is fairly simple as the <c>emerge</c> command provides a
69front-end for rsync: 78front-end for rsync:
70</p> 79</p>
71 80
72<pre caption="Updating the Portage tree"> 81<pre caption="Updating the Portage tree">
93<title>Searching for Software</title> 102<title>Searching for Software</title>
94<body> 103<body>
95 104
96<p> 105<p>
97To search through the Portage tree after software titles, you can use 106To search through the Portage tree after software titles, you can use
98<c>emerge</c> built-in search capabilities. By default, <c>emerge search</c> 107<c>emerge</c> built-in search capabilities. By default, <c>emerge --search</c>
99returns package names whos title corresponds with (either fully or partially) 108returns the names of packages whose title matches (either fully or partially)
100the given search term. 109the given search term.
101</p> 110</p>
102 111
103<p> 112<p>
104For instance, to search for all packages who have "pdf" in their name: 113For instance, to search for all packages who have "pdf" in their name:
105</p> 114</p>
106 115
107<pre caption="Searching for pdf-named packages"> 116<pre caption="Searching for pdf-named packages">
108$ <i>emerge search pdf</i> 117$ <i>emerge --search pdf</i>
109</pre> 118</pre>
110 119
111<p> 120<p>
112If you want to search through the descriptions as well you can use the 121If you want to search through the descriptions as well you can use the
113<c>--searchdesc</c> (or <c>-S</c>) switch: 122<c>--searchdesc</c> (or <c>-S</c>) switch:
121When you take a look at the output, you'll notice that it gives you a lot of 130When you take a look at the output, you'll notice that it gives you a lot of
122information. The fields are clearly labelled so we won't go further into their 131information. The fields are clearly labelled so we won't go further into their
123meanings: 132meanings:
124</p> 133</p>
125 134
126<pre caption="Example emerge search output"> 135<pre caption="Example 'emerge --search' output">
127* net-print/cups-pdf 136* net-print/cups-pdf
128 Latest version available: 1.5.2 137 Latest version available: 1.5.2
129 Latest version installed: [ Not Installed ] 138 Latest version installed: [ Not Installed ]
130 Size of downloaded files: 15 kB 139 Size of downloaded files: 15 kB
131 Homepage: http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/ 140 Homepage: http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/
174</pre> 183</pre>
175 184
176</body> 185</body>
177</subsection> 186</subsection>
178<subsection> 187<subsection>
188<title>Finding Installed Package Documentation</title>
189<body>
190
191<p>
192Many packages come with their own documentation. Sometimes, the <c>doc</c> USE
193flag determines whether the package documentation should be installed or not.
194You can check the existence of a <c>doc</c> USE flag with the <c>emerge -vp
195&lt;package name&gt;</c> command.
196</p>
197
198<pre caption="Checking the existence of a doc USE flag">
199<comment>(alsa-lib is just an example, of course.)</comment>
200# <i>emerge -vp alsa-lib</i>
201[ebuild N ] media-libs/alsa-lib-1.0.14_rc1 -debug +doc 698 kB
202</pre>
203
204<p>
205You can enable or disable the <c>doc</c> USE flag either globally in the
206<path>/etc/make.conf</path> file or per package in the
207<path>/etc/portage/package.use</path> file. The <uri
208link="?part=2&amp;chap=2">USE Flags</uri> chapter covers this aspect in detail.
209</p>
210
211<p>
212Once the package installed, its documentation is generally found in a
213subdirectory named after the package under the <path>/usr/share/doc</path>
214directory. You can also list all installed files with the <c>equery</c> tool
215which is part of the <c>app-portage/gentoolkit</c> <uri
216link="/doc/en/gentoolkit.xml">package</uri>.
217</p>
218
219<pre caption="Locating package documentation">
220# <i>ls -l /usr/share/doc/alsa-lib-1.0.14_rc1</i>
221total 28
222-rw-r--r-- 1 root root 669 May 17 21:54 ChangeLog.gz
223-rw-r--r-- 1 root root 9373 May 17 21:54 COPYING.gz
224drwxr-xr-x 2 root root 8560 May 17 21:54 html
225-rw-r--r-- 1 root root 196 May 17 21:54 TODO.gz
226
227<comment>(Alternatively, use equery to locate interesting files:)</comment>
228# <i>equery files alsa-lib | less</i>
229media-libs/alsa-lib-1.0.14_rc1
230* Contents of media-libs/alsa-lib-1.0.14_rc1:
231/usr
232/usr/bin
233/usr/bin/alsalisp
234<comment>(Output truncated)</comment>
235</pre>
236
237</body>
238</subsection>
239<subsection>
179<title>Removing Software</title> 240<title>Removing Software</title>
180<body> 241<body>
181 242
182<p> 243<p>
183When you want to remove a software package from your system, use <c>emerge 244When you want to remove a software package from your system, use <c>emerge
184unmerge</c>. This will tell Portage to remove all files installed by that 245--unmerge</c>. This will tell Portage to remove all files installed by that
185package from your system <e>except</e> the configuration files of that 246package from your system <e>except</e> the configuration files of that
186application if you have altered those after the installation. Leaving the 247application if you have altered those after the installation. Leaving the
187configuration files allows you to continue working with the package if you ever 248configuration files allows you to continue working with the package if you ever
188decide to install it again. 249decide to install it again.
189</p> 250</p>
194warn you when you want to remove an important package that breaks your system 255warn you when you want to remove an important package that breaks your system
195if you unmerge it. 256if you unmerge it.
196</p> 257</p>
197 258
198<pre caption="Removing gnumeric from the system"> 259<pre caption="Removing gnumeric from the system">
199# <i>emerge unmerge gnumeric</i> 260# <i>emerge --unmerge gnumeric</i>
200</pre> 261</pre>
201 262
202<p> 263<p>
203When you remove a package from your system, the dependencies of that package 264When you remove a package from your system, the dependencies of that package
204that were installed automatically when you installed the software are left. To 265that were installed automatically when you installed the software are left. To
205have Portage locate all dependencies that can now be removed, use 266have Portage locate all dependencies that can now be removed, use
206<c>emerge</c>'s <c>depclean</c> functionality. We will talk about this later on. 267<c>emerge</c>'s <c>--depclean</c> functionality. We will talk about this later
268on.
207</p> 269</p>
208 270
209</body> 271</body>
210</subsection> 272</subsection>
211<subsection> 273<subsection>
215<p> 277<p>
216To keep your system in perfect shape (and not to mention install the latest 278To keep your system in perfect shape (and not to mention install the latest
217security updates) you need to update your system regularly. Since Portage only 279security updates) you need to update your system regularly. Since Portage only
218checks the ebuilds in your Portage tree you first have to update your Portage 280checks the ebuilds in your Portage tree you first have to update your Portage
219tree. When your Portage tree is updated, you can update your system with 281tree. When your Portage tree is updated, you can update your system with
220<c>emerge --update world</c>: 282<c>emerge --update world</c>. In the next example, we'll also use the
283<c>--ask</c> switch which will tell Portage to display the list of packages it
284wants to upgrade and ask you if you want to continue:
221</p> 285</p>
222 286
223<pre caption="Updating your system"> 287<pre caption="Updating your system">
224# <i>emerge --update world</i> 288# <i>emerge --update --ask world</i>
225</pre> 289</pre>
226 290
227<p> 291<p>
228Portage will then search for newer version of the applications you have 292Portage will then search for newer version of the applications you have
229installed. However, it will only verify the versions for the applications you 293installed. However, it will only verify the versions for the applications you
230have explicitly installed - not the dependencies. If you want to update every 294have <e>explicitly</e> installed (the applications listed in
231single package on your system, add the <c>--deep</c> argument: 295<path>/var/lib/portage/world</path>) - it does not thoroughly check their
296dependencies. If you want to update <e>every single package</e> on your system,
297add the <c>--deep</c> argument:
232</p> 298</p>
233 299
234<pre caption="Updating your entire system"> 300<pre caption="Updating your entire system">
235# <i>emerge --update --deep world</i> 301# <i>emerge --update --deep world</i>
236</pre> 302</pre>
303
304<p>
305Since security updates also happen in packages you have not explicitly installed
306on your system (but that are pulled in as dependencies of other programs), it
307is recommended to run this command once in a while.
308</p>
237 309
238<p> 310<p>
239If you have altered any of your <uri link="?part=2&amp;chap=2">USE flags</uri> 311If you have altered any of your <uri link="?part=2&amp;chap=2">USE flags</uri>
240lately you might want to add <c>--newuse</c> as well. Portage will then verify 312lately you might want to add <c>--newuse</c> as well. Portage will then verify
241if the change requires the installation of new packages or recompilation of 313if the change requires the installation of new packages or recompilation of
247</pre> 319</pre>
248 320
249</body> 321</body>
250</subsection> 322</subsection>
251<subsection> 323<subsection>
252<title>Stub Packages</title> 324<title>Metapackages</title>
253<body> 325<body>
254 326
255<p> 327<p>
256Some packages in the Portage tree don't have any real content but are used to 328Some packages in the Portage tree don't have any real content but are used to
257install a collection of packages. For instance, the <c>kde</c> package will 329install a collection of packages. For instance, the <c>kde</c> package will
259KDE-related packages as dependencies. 331KDE-related packages as dependencies.
260</p> 332</p>
261 333
262<p> 334<p>
263If you ever want to remove such a package from your system, running <c>emerge 335If you ever want to remove such a package from your system, running <c>emerge
264unmerge</c> on the package won't have much effect as the dependencies remain on 336--unmerge</c> on the package won't have much effect as the dependencies remain
265the system. 337on the system.
266</p> 338</p>
267 339
268<p> 340<p>
269Portage has the functionality to remove orphaned dependencies as well, but since 341Portage has the functionality to remove orphaned dependencies as well, but since
270the availability of software is dynamically dependent you first need to update 342the availability of software is dynamically dependent you first need to update
271your entire system fully, including the new changes you applied when changing 343your entire system fully, including the new changes you applied when changing
272USE flags. After this you can run <c>emerge depclean</c> to remove the orphaned 344USE flags. After this you can run <c>emerge --depclean</c> to remove the
273dependencies. When this is done, you need to rebuild the applications that were 345orphaned dependencies. When this is done, you need to rebuild the applications
274dynamically linked to the now-removed software titles but don't require them 346that were dynamically linked to the now-removed software titles but don't
275anymore. 347require them anymore.
276</p> 348</p>
277 349
278<p> 350<p>
279All this is handled with the following three commands: 351All this is handled with the following three commands:
280</p> 352</p>
281 353
282<pre caption="Removing orphaned dependencies"> 354<pre caption="Removing orphaned dependencies">
283# <i>emerge --update --deep --newuse world</i> 355# <i>emerge --update --deep --newuse world</i>
284# <i>emerge depclean</i> 356# <i>emerge --depclean</i>
285# <i>revdep-rebuild</i> 357# <i>revdep-rebuild</i>
286</pre> 358</pre>
287 359
288<p> 360<p>
289<c>revdep-rebuild</c> is provided by the <c>gentoolkit</c> package; don't forget 361<c>revdep-rebuild</c> is provided by the <c>gentoolkit</c> package; don't forget
304<body> 376<body>
305 377
306<p> 378<p>
307As we stated before, Portage is extremely powerful and supports many features 379As we stated before, Portage is extremely powerful and supports many features
308that other software management tools lack. To understand this, we explain a few 380that other software management tools lack. To understand this, we explain a few
309aspects of Portage without going in too much detail. 381aspects of Portage without going into too much detail.
310</p> 382</p>
311 383
312<p> 384<p>
313With Portage different versions of a single package can coexist on a system. 385With Portage different versions of a single package can coexist on a system.
314While other distributions tend to name their package to those versions (like 386While other distributions tend to name their package to those versions (like
355<subsection id="blocked"> 427<subsection id="blocked">
356<title>Blocked Packages</title> 428<title>Blocked Packages</title>
357<body> 429<body>
358 430
359<pre caption="Portage warning about blocked packages (with --pretend)"> 431<pre caption="Portage warning about blocked packages (with --pretend)">
360[blocks B ] gnome-base/bonobo-activation (from pkg gnome-base/libbonobo-2.4.0) 432[blocks B ] mail-mta/ssmtp (is blocking mail-mta/postfix-2.2.2-r1)
361</pre> 433</pre>
362 434
363<pre caption="Portage warning about blocked packages (without --pretend)"> 435<pre caption="Portage warning about blocked packages (without --pretend)">
364!!! Error: the gnome-base/bonobo-activation package conflicts with another package. 436!!! Error: the mail-mta/postfix package conflicts with another package.
365!!! both can't be installed on the same system together. 437!!! both can't be installed on the same system together.
366!!! Please use 'emerge --pretend' to determine blockers. 438!!! Please use 'emerge --pretend' to determine blockers.
367</pre> 439</pre>
368 440
369<p> 441<p>
370Ebuilds contain specific fields that inform Portage about it's dependencies. 442Ebuilds contain specific fields that inform Portage about its dependencies.
371There are two possible dependencies: build dependencies, declared in 443There are two possible dependencies: build dependencies, declared in
372<c>DEPEND</c> and run-time dependencies, declared in <c>RDEPEND</c>. When one of 444<c>DEPEND</c> and run-time dependencies, declared in <c>RDEPEND</c>. When one of
373these dependencies explicitly marks a package or virtual as being <e>not</e> 445these dependencies explicitly marks a package or virtual as being <e>not</e>
374compatible, it triggers a blockage. 446compatible, it triggers a blockage.
375</p> 447</p>
376 448
377<p> 449<p>
378To fix a blockage, you can choose to not install the package or unmerge the 450To fix a blockage, you can choose to not install the package or unmerge the
379conflicting package first. In the given example, you can opt not to install 451conflicting package first. In the given example, you can opt not to install
380<c>libbonobo</c> or to remove <c>bonobo-activation</c> first. 452<c>postfix</c> or to remove <c>ssmtp</c> first.
453</p>
454
455<p>
456You may also see blocking packages with specific atoms, such as
457<b>&lt;</b>media-video/mplayer-bin-1.0_rc1-r2. In this case, updating to a more
458recent version of the blocking package would remove the block.
459</p>
460
461<p>
462It is also possible that two packages that are yet to be installed are blocking
463each other. In this rare case, you should find out why you need to install both.
464In most cases you can do with one of the packages alone. If not, please file a
465bug on <uri link="http://bugs.gentoo.org">Gentoo's bugtracking system</uri>.
381</p> 466</p>
382 467
383</body> 468</body>
384</subsection> 469</subsection>
385<subsection id="masked"> 470<subsection id="masked">
440<subsection id="missingdependencies"> 525<subsection id="missingdependencies">
441<title>Missing Dependencies</title> 526<title>Missing Dependencies</title>
442<body> 527<body>
443 528
444<pre caption="Portage warning about missing dependency"> 529<pre caption="Portage warning about missing dependency">
445emerge: there are no ebuilds to satisfy "&gt;=sys-devel/gcc-4.2-r4". 530emerge: there are no ebuilds to satisfy "&gt;=sys-devel/gcc-3.4.2-r4".
446 531
447!!! Problem with ebuild sys-devel/gcc-3.4.2-r2 532!!! Problem with ebuild sys-devel/gcc-3.4.2-r2
448!!! Possibly a DEPEND/*DEPEND problem. 533!!! Possibly a DEPEND/*DEPEND problem.
449</pre> 534</pre>
450 535
538from the system. 623from the system.
539</p> 624</p>
540 625
541</body> 626</body>
542</subsection> 627</subsection>
628<subsection id="digesterror">
629<title>Digest Verification Failures</title>
630<body>
631
632<p>
633Sometimes, when you attempt to emerge a package, it will fail with the message:
634</p>
635
636<pre caption="Digest verification failure">
637&gt;&gt;&gt; checking ebuild checksums
638!!! Digest verification failed:
639</pre>
640
641<p>
642This is a sign that something is wrong with the Portage tree -- often, it is
643because a developer may have made a mistake when committing a package to the
644tree.
645</p>
646
647<p>
648When the digest verification fails, do <e>not</e> try to re-digest the package
649yourself. Running <c>ebuild foo digest</c> will not fix the problem; it will
650almost certainly make it worse!
651</p>
652
653<p>
654Instead, wait an hour or two for the tree to settle down. It's likely that the
655error was noticed right away, but it can take a little time for the fix to
656trickle down the Portage tree. While you're waiting, check <uri
657link="http://bugs.gentoo.org">Bugzilla</uri> and see if anyone has reported
658the problem yet. If not, go ahead and file a bug for the broken package.
659</p>
660
661<p>
662Once you see that the bug has been fixed, you may want to re-sync to pick up
663the fixed digest.
664</p>
665
666<impo>
667This does <e>not</e> mean that you can re-sync your tree multiple times! As
668stated in the rsync policy (when you run <c>emerge --sync</c>), users who sync
669too often will be banned! In fact, it's better to just wait until your next
670scheduled sync, so that you don't overload the rsync servers.
671</impo>
672
673</body>
674</subsection>
543</section> 675</section>
544</sections> 676</sections>

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.20