/[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.58
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.58 2006/08/01 17:35:05 swift Exp $ -->
8 8
9<sections> 9<sections>
10
11<version>1.53</version>
12<date>2006-08-01</date>
13
10<section> 14<section>
11<title>Welcome to Portage</title> 15<title>Welcome to Portage</title>
12<body> 16<body>
13 17
14<p> 18<p>
62<title>Updating the Portage Tree</title> 66<title>Updating the Portage Tree</title>
63<body> 67<body>
64 68
65<p> 69<p>
66The Portage tree is usually updated with <uri 70The Portage tree is usually updated with <uri
67link="http://rsync.gentoo.org">rsync</uri>, a fast incremental file transfer 71link="http://rsync.samba.org/">rsync</uri>, a fast incremental file transfer
68utility. Updating is fairly simple as the <c>emerge</c> command provides a 72utility. Updating is fairly simple as the <c>emerge</c> command provides a
69front-end for rsync: 73front-end for rsync:
70</p> 74</p>
71 75
72<pre caption="Updating the Portage tree"> 76<pre caption="Updating the Portage tree">
93<title>Searching for Software</title> 97<title>Searching for Software</title>
94<body> 98<body>
95 99
96<p> 100<p>
97To search through the Portage tree after software titles, you can use 101To 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> 102<c>emerge</c> built-in search capabilities. By default, <c>emerge --search</c>
99returns package names whos title corresponds with (either fully or partially) 103returns the names of packages whose title matches (either fully or partially)
100the given search term. 104the given search term.
101</p> 105</p>
102 106
103<p> 107<p>
104For instance, to search for all packages who have "pdf" in their name: 108For instance, to search for all packages who have "pdf" in their name:
105</p> 109</p>
106 110
107<pre caption="Searching for pdf-named packages"> 111<pre caption="Searching for pdf-named packages">
108$ <i>emerge search pdf</i> 112$ <i>emerge --search pdf</i>
109</pre> 113</pre>
110 114
111<p> 115<p>
112If you want to search through the descriptions as well you can use the 116If you want to search through the descriptions as well you can use the
113<c>--searchdesc</c> (or <c>-S</c>) switch: 117<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 125When 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 126information. The fields are clearly labelled so we won't go further into their
123meanings: 127meanings:
124</p> 128</p>
125 129
126<pre caption="Example emerge search output"> 130<pre caption="Example 'emerge --search' output">
127* net-print/cups-pdf 131* net-print/cups-pdf
128 Latest version available: 1.5.2 132 Latest version available: 1.5.2
129 Latest version installed: [ Not Installed ] 133 Latest version installed: [ Not Installed ]
130 Size of downloaded files: 15 kB 134 Size of downloaded files: 15 kB
131 Homepage: http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/ 135 Homepage: http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/
174</pre> 178</pre>
175 179
176</body> 180</body>
177</subsection> 181</subsection>
178<subsection> 182<subsection>
183<title>Finding Installed Package Documentation</title>
184<body>
185
186<p>
187Many packages come with their own documentation. Sometimes, the <c>doc</c> USE
188flag determines whether the package documentation should be installed or not.
189You can check the existence of a <c>doc</c> USE flag with the <c>emerge -vp
190&lt;package name&gt;</c> command.
191</p>
192
193<pre caption="Checking the existence of a doc USE flag">
194<comment>(alsa-lib is just an example, of course.)</comment>
195# <i>emerge -vp alsa-lib</i>
196[ebuild N ] media-libs/alsa-lib-1.0.9_rc3 +doc -jack 674 kB
197</pre>
198
199<p>
200You can enable or disable the <c>doc</c> USE flag either globally in the
201<path>/etc/make.conf</path> file or per package in the
202<path>/etc/portage/package.use</path> file. You can also create a directory
203called <path>/etc/portage/package.use</path> and list it in a file inside this
204directory. The <uri
205link="?part=2&amp;chap=2">USE Flags</uri> chapter covers this aspect in detail.
206</p>
207
208<p>
209Once the package installed, its documentation is generally found in a
210subdirectory named after the package under the <path>/usr/share/doc</path>
211directory. You can also list all installed files with the <c>equery</c> tool
212which is part of the <c>app-portage/gentoolkit</c> <uri
213link="/doc/en/gentoolkit.xml">package</uri>.
214</p>
215
216<pre caption="Locating package documentation">
217# <i>ls -l /usr/share/doc/alsa-lib-1.0.9_rc3</i>
218total 28
219-rw-r--r-- 1 root root 669 May 17 21:54 ChangeLog.gz
220-rw-r--r-- 1 root root 9373 May 17 21:54 COPYING.gz
221drwxr-xr-x 2 root root 8560 May 17 21:54 html
222-rw-r--r-- 1 root root 196 May 17 21:54 TODO.gz
223
224<comment>(Alternatively, use equery to locate interesting files:)</comment>
225# <i>equery files alsa-lib | less</i>
226media-libs/alsa-lib-1.0.9_rc3
227* Contents of media-libs/alsa-lib-1.0.9_rc3:
228/usr
229/usr/bin
230/usr/bin/alsalisp
231<comment>(Output truncated)</comment>
232</pre>
233
234</body>
235</subsection>
236<subsection>
179<title>Removing Software</title> 237<title>Removing Software</title>
180<body> 238<body>
181 239
182<p> 240<p>
183When you want to remove a software package from your system, use <c>emerge 241When 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 242--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 243package from your system <e>except</e> the configuration files of that
186application if you have altered those after the installation. Leaving the 244application if you have altered those after the installation. Leaving the
187configuration files allows you to continue working with the package if you ever 245configuration files allows you to continue working with the package if you ever
188decide to install it again. 246decide to install it again.
189</p> 247</p>
194warn you when you want to remove an important package that breaks your system 252warn you when you want to remove an important package that breaks your system
195if you unmerge it. 253if you unmerge it.
196</p> 254</p>
197 255
198<pre caption="Removing gnumeric from the system"> 256<pre caption="Removing gnumeric from the system">
199# <i>emerge unmerge gnumeric</i> 257# <i>emerge --unmerge gnumeric</i>
200</pre> 258</pre>
201 259
202<p> 260<p>
203When you remove a package from your system, the dependencies of that package 261When you remove a package from your system, the dependencies of that package
204that were installed automatically when you installed the software are left. To 262that were installed automatically when you installed the software are left. To
205have Portage locate all dependencies that can now be removed, use 263have 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. 264<c>emerge</c>'s <c>--depclean</c> functionality. We will talk about this later
265on.
207</p> 266</p>
208 267
209</body> 268</body>
210</subsection> 269</subsection>
211<subsection> 270<subsection>
215<p> 274<p>
216To keep your system in perfect shape (and not to mention install the latest 275To 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 276security 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 277checks 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 278tree. When your Portage tree is updated, you can update your system with
220<c>emerge --update world</c>: 279<c>emerge --update world</c>. In the next example, we'll also use the
280<c>--ask</c> switch which will tell Portage to display the list of packages it
281wants to upgrade and ask you if you want to continue:
221</p> 282</p>
222 283
223<pre caption="Updating your system"> 284<pre caption="Updating your system">
224# <i>emerge --update world</i> 285# <i>emerge --update --ask world</i>
225</pre> 286</pre>
226 287
227<p> 288<p>
228Portage will then search for newer version of the applications you have 289Portage will then search for newer version of the applications you have
229installed. However, it will only verify the versions for the applications you 290installed. However, it will only verify the versions for the applications you
234<pre caption="Updating your entire system"> 295<pre caption="Updating your entire system">
235# <i>emerge --update --deep world</i> 296# <i>emerge --update --deep world</i>
236</pre> 297</pre>
237 298
238<p> 299<p>
300Since security updates also happen in packages you have not explicitly installed
301on your system (but that are pulled in as dependencies of other programs), it
302is recommended to run this command once in a while.
303</p>
304
305<p>
239If you have altered any of your <uri link="?part=2&amp;chap=2">USE flags</uri> 306If 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 307lately 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 308if the change requires the installation of new packages or recompilation of
242existing ones: 309existing ones:
243</p> 310</p>
247</pre> 314</pre>
248 315
249</body> 316</body>
250</subsection> 317</subsection>
251<subsection> 318<subsection>
252<title>Stub Packages</title> 319<title>Metapackages</title>
253<body> 320<body>
254 321
255<p> 322<p>
256Some packages in the Portage tree don't have any real content but are used to 323Some 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 324install a collection of packages. For instance, the <c>kde</c> package will
259KDE-related packages as dependencies. 326KDE-related packages as dependencies.
260</p> 327</p>
261 328
262<p> 329<p>
263If you ever want to remove such a package from your system, running <c>emerge 330If 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 331--unmerge</c> on the package won't have much effect as the dependencies remain
265the system. 332on the system.
266</p> 333</p>
267 334
268<p> 335<p>
269Portage has the functionality to remove orphaned dependencies as well, but since 336Portage has the functionality to remove orphaned dependencies as well, but since
270the availability of software is dynamically dependent you first need to update 337the availability of software is dynamically dependent you first need to update
271your entire system fully, including the new changes you applied when changing 338your 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 339USE 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 340orphaned dependencies. When this is done, you need to rebuild the applications
274dynamically linked to the now-removed software titles but don't require them 341that were dynamically linked to the now-removed software titles but don't
275anymore. 342require them anymore.
276</p> 343</p>
277 344
278<p> 345<p>
279All this is handled with the following three commands: 346All this is handled with the following three commands:
280</p> 347</p>
281 348
282<pre caption="Removing orphaned dependencies"> 349<pre caption="Removing orphaned dependencies">
283# <i>emerge --update --deep --newuse world</i> 350# <i>emerge --update --deep --newuse world</i>
284# <i>emerge depclean</i> 351# <i>emerge --depclean</i>
285# <i>revdep-rebuild</i> 352# <i>revdep-rebuild</i>
286</pre> 353</pre>
287 354
288<p> 355<p>
289<c>revdep-rebuild</c> is provided by the <c>gentoolkit</c> package; don't forget 356<c>revdep-rebuild</c> is provided by the <c>gentoolkit</c> package; don't forget
304<body> 371<body>
305 372
306<p> 373<p>
307As we stated before, Portage is extremely powerful and supports many features 374As we stated before, Portage is extremely powerful and supports many features
308that other software management tools lack. To understand this, we explain a few 375that other software management tools lack. To understand this, we explain a few
309aspects of Portage without going in too much detail. 376aspects of Portage without going into too much detail.
310</p> 377</p>
311 378
312<p> 379<p>
313With Portage different versions of a single package can coexist on a system. 380With Portage different versions of a single package can coexist on a system.
314While other distributions tend to name their package to those versions (like 381While other distributions tend to name their package to those versions (like
355<subsection id="blocked"> 422<subsection id="blocked">
356<title>Blocked Packages</title> 423<title>Blocked Packages</title>
357<body> 424<body>
358 425
359<pre caption="Portage warning about blocked packages (with --pretend)"> 426<pre caption="Portage warning about blocked packages (with --pretend)">
360[blocks B ] gnome-base/bonobo-activation (from pkg gnome-base/libbonobo-2.4.0) 427[blocks B ] mail-mta/ssmtp (is blocking mail-mta/postfix-2.2.2-r1)
361</pre> 428</pre>
362 429
363<pre caption="Portage warning about blocked packages (without --pretend)"> 430<pre caption="Portage warning about blocked packages (without --pretend)">
364!!! Error: the gnome-base/bonobo-activation package conflicts with another package. 431!!! Error: the mail-mta/postfix package conflicts with another package.
365!!! both can't be installed on the same system together. 432!!! both can't be installed on the same system together.
366!!! Please use 'emerge --pretend' to determine blockers. 433!!! Please use 'emerge --pretend' to determine blockers.
367</pre> 434</pre>
368 435
369<p> 436<p>
370Ebuilds contain specific fields that inform Portage about it's dependencies. 437Ebuilds contain specific fields that inform Portage about its dependencies.
371There are two possible dependencies: build dependencies, declared in 438There are two possible dependencies: build dependencies, declared in
372<c>DEPEND</c> and run-time dependencies, declared in <c>RDEPEND</c>. When one of 439<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> 440these dependencies explicitly marks a package or virtual as being <e>not</e>
374compatible, it triggers a blockage. 441compatible, it triggers a blockage.
375</p> 442</p>
376 443
377<p> 444<p>
378To fix a blockage, you can choose to not install the package or unmerge the 445To 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 446conflicting package first. In the given example, you can opt not to install
380<c>libbonobo</c> or to remove <c>bonobo-activation</c> first. 447<c>postfix</c> or to remove <c>ssmtp</c> first.
448</p>
449
450<p>
451It is also possible that two packages that are yet to be installed are blocking
452each other. In this rare case, you should find out why you need to install both.
453In most cases you can do with one of the packages alone. If not, please file a
454bug on <uri link="http://bugs.gentoo.org">Gentoo's bugtracking system</uri>.
381</p> 455</p>
382 456
383</body> 457</body>
384</subsection> 458</subsection>
385<subsection id="masked"> 459<subsection id="masked">
440<subsection id="missingdependencies"> 514<subsection id="missingdependencies">
441<title>Missing Dependencies</title> 515<title>Missing Dependencies</title>
442<body> 516<body>
443 517
444<pre caption="Portage warning about missing dependency"> 518<pre caption="Portage warning about missing dependency">
445emerge: there are no ebuilds to satisfy "&gt;=sys-devel/gcc-4.2-r4". 519emerge: there are no ebuilds to satisfy "&gt;=sys-devel/gcc-3.4.2-r4".
446 520
447!!! Problem with ebuild sys-devel/gcc-3.4.2-r2 521!!! Problem with ebuild sys-devel/gcc-3.4.2-r2
448!!! Possibly a DEPEND/*DEPEND problem. 522!!! Possibly a DEPEND/*DEPEND problem.
449</pre> 523</pre>
450 524

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

  ViewVC Help
Powered by ViewVC 1.1.20