/[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.14 Revision 1.15
1<!-- The content of this document is licensed under the CC-BY-SA license --> 1<!-- The content of this document is licensed under the CC-BY-SA license -->
2<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 2<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3 3
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.14 2003/12/16 17:59:46 swift Exp $ --> 4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.15 2004/01/06 15:28:05 swift Exp $ -->
5 5
6<sections> 6<sections>
7<section> 7<section>
8<title>Obtaining Package Information</title> 8<title>Obtaining Package Information</title>
9<subsection> 9<subsection>
10<title>The Lord of All Tools: emerge</title> 10<title>The Lord of All Tools: emerge</title>
11<body> 11<body>
12 12
13<p> 13<p>
14The main Portage tool that most users will use is <c>emerge</c>. We have already 14The 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 15used 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> 16briefly explained how to use it. This chapter will elaborate on <c>emerge</c>
17and teach you how to use <c>emerge</c> to fix all your software-related needs. 17and teach you how to use <c>emerge</c> to fix all your software-related needs.
18</p> 18</p>
19 19
214 Size of downloaded files: 2,782 kB 214 Size of downloaded files: 2,782 kB
215 Homepage: http://www.mozilla.org/projects/security/pki/nss/ 215 Homepage: http://www.mozilla.org/projects/security/pki/nss/
216 Description: Mozilla's Netscape Security Services Library that implements PKI support 216 Description: Mozilla's Netscape Security Services Library that implements PKI support
217</pre> 217</pre>
218 218
219<p> 219<p>
220As you can see, the output of <c>emerge</c> informs you about the category and 220As you can see, the output of <c>emerge</c> informs you about the category and
221name of the package, the available version, the currently installed version, 221name of the package, the available version, the currently installed version,
222the size of the downloaded files, the homepage and the small description. 222the size of the downloaded files, the homepage and the small description.
223</p> 223</p>
224 224
225<p> 225<p>
226You see something new? Yes, <e>downloaded files</e>. When you tell Portage to 226You 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 227install a package, it of course needs to have the necessary sources (or
228precompiled packages) available. It therefore checks the contents of 228precompiled packages) available. It therefore checks the contents of
229<path>/usr/portage/distfiles</path> (for sourcecode) or 229<path>/usr/portage/distfiles</path> (for source code) or
230<path>/usr/portage/packages/All</path> (for precompiled packages) to see if the 230<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 231necessary files are already available. If not, it downloads the necessary files
232and places them in those directories. 232and places them in those directories.
233</p> 233</p>
234 234
235<!-- 235<!--
236<note> 236<note>
237Searching the Portage Tree, especially when using <c>- -searchdesc</c>, is very 237Searching the Portage Tree, especially when using <c>- -searchdesc</c>, is very
238time consuming. There are other, more performant tools available. We will 238time consuming. There are other, more performant tools available. We will
239describe those in the chapter on <uri link="?part=2&amp;chap=7">Gentoolkit and 239describe those in the chapter on <uri link="?part=2&amp;chap=7">Gentoolkit and
240Other Tools</uri>. 240Other Tools</uri>.
241</note> 241</note>
242--> 242-->
243 243
244</body> 244</body>
290<p> 290<p>
291It is adviseable to first select a fast <uri 291It is adviseable to first select a fast <uri
292link="/main/en/mirrors.xml">mirror</uri> close to you. You can do this manually 292link="/main/en/mirrors.xml">mirror</uri> close to you. You can do this manually
293(by setting the <c>SYNC</c> variable in <path>/etc/make.conf</path>) or use 293(by setting the <c>SYNC</c> variable in <path>/etc/make.conf</path>) or use
294<c>mirrorselect</c> to do this for you automatically. As the <c>SYNC</c> 294<c>mirrorselect</c> to do this for you automatically. As the <c>SYNC</c>
295variable will be discussed later on, we will focus on using <c>mirrorselect</c>. 295variable will be discussed later on, we will focus on using <c>mirrorselect</c>.
296First install <c>mirrorselect</c> by emerging it: 296First install <c>mirrorselect</c> by emerging it:
297</p> 297</p>
298 298
299<pre caption="Installing mirrorselect"> 299<pre caption="Installing mirrorselect">
300# <i>emerge --usepkg mirrorselect</i> 300# <i>emerge --usepkg mirrorselect</i>
301</pre> 301</pre>
302 302
303<p> 303<p>
304Now run <c>mirrorselect</c> to automatically select mirrors for you (it will 304Now run <c>mirrorselect</c> to automatically select mirrors for you (it will
305also setup Portage to use a mirror for the sourcecode): 305also setup Portage to use a mirror for the source code):
306</p> 306</p>
307 307
308<pre caption="Running mirrorselect"> 308<pre caption="Running mirrorselect">
309# <i>mirrorselect -a -s3</i> 309# <i>mirrorselect -a -s3</i>
310</pre> 310</pre>
311 311
312</body> 312</body>
313</subsection> 313</subsection>
314<subsection> 314<subsection>
315<title>Updating Portage</title> 315<title>Updating Portage</title>
316<body> 316<body>
317 317
318<p> 318<p>
319To update Portage using rsync, simply run <c>emerge sync</c>: 319To update Portage using rsync, simply run <c>emerge sync</c>:
320</p> 320</p>
333<pre caption="Updating Portage using emerge-webrsync"> 333<pre caption="Updating Portage using emerge-webrsync">
334# <i>emerge-webrsync</i> 334# <i>emerge-webrsync</i>
335</pre> 335</pre>
336 336
337</body> 337</body>
338</subsection> 338</subsection>
339</section> 339</section>
340<section> 340<section>
341<title>Maintaining Software</title> 341<title>Maintaining Software</title>
342<subsection> 342<subsection>
343<title>Building or Prebuilt?</title> 343<title>Building or Prebuilt?</title>
344<body> 344<body>
345 345
346<p> 346<p>
347Gentoo provides ebuilds, the Gentoo packages if you like. But when you want to 347Gentoo provides ebuilds, the Gentoo packages if you like. But when you want to
348install such an ebuild, you can choose between <e>building</e> the package, or 348install such an ebuild, you can choose between <e>building</e> the package and
349using a <e>prebuilt</e> package. But what are the advantages/disadvantages of 349using a <e>prebuilt</e> package. But what are the advantages/disadvantages of
350both approaches, and can they be used next to each other? 350both approaches, and can they be used next to each other?
351</p> 351</p>
352 352
353<p> 353<p>
354As you probably have guessed, building packages takes a lot of time (especially 354As you probably have guessed, building packages takes a lot of time (especially
355if you have little resources or want to build big packages, such as <uri 355if you have little resources or want to build big packages, such as <uri
356link="http://www.kde.org">KDE</uri>, <uri 356link="http://www.kde.org">KDE</uri>, <uri
357link="http://www.openoffice.org">OpenOffice.org</uri>, etc.). By building the 357link="http://www.openoffice.org">OpenOffice.org</uri>, etc.). By building the
358package, you can use the <c>USE</c> setting to tweak the package to your system. 358package, you can use the <c>USE</c> setting to tweak the package to your system.
359Of course, you can also define high optimization options (in the <c>CFLAGS</c> 359Of course, you can also define high optimization options (in the <c>CFLAGS</c>
360and <c>CXXFLAGS</c> variables) to compile the package with. 360and <c>CXXFLAGS</c> variables) to compile the package with.
361</p> 361</p>
362 362
363<p> 363<p>
364Using prebuilt packages improves the installation time (as no more compilation 364Using prebuilt packages improves the installation time (as no more compilation
365is needed), but you will lose the advantages of the <c>USE</c> setting and the 365is needed), but you will lose the advantages of the <c>USE</c> setting and the
366<c>CFLAGS</c> &amp; <c>CXXFLAGS</c> variables. 366<c>CFLAGS</c> &amp; <c>CXXFLAGS</c> variables.
367</p> 367</p>
368 368
369<p> 369<p>
370As previously stated, prebuilt packages are stored in the 370As previously stated, prebuilt packages are stored in the
371<path>/usr/portage/packages/All</path> directory, while the sourcecode of the 371<path>/usr/portage/packages/All</path> directory, while the source code of the
372packages are placed in <path>/usr/portage/distfiles</path>. If you have finished 372packages is placed in <path>/usr/portage/distfiles</path>. If you have finished
373installing a package you can remove the package or sourcecode from the 373installing a package you can remove the package or source code from the
374respective directory. However, you might want to keep the package/sourcecode of 374respective directory. However, you might want to keep the package/source code of
375the latest version, just in case you want to reinstall the package (so you don't 375the latest version, just in case you want to reinstall the package (so you don't
376have to redownload it). 376have to redownload it).
377</p> 377</p>
378 378
379</body> 379</body>
380</subsection> 380</subsection>
381<subsection> 381<subsection>
382<title>Installing Software from Sources</title> 382<title>Installing Software from Sources</title>
383<body> 383<body>
384 384
385<p> 385<p>
386Okay, enough talking, let's cut to the chase. To install a package, you will use 386Okay, enough talking, let's cut to the chase. To install a package, you will use
387the <c>emerge</c> command. If you don't want to use any prebuilt packages, you 387the <c>emerge</c> command. If you don't want to use any prebuilt packages, you
388can just use <c>emerge &lt;package-name&gt;</c> or <c>emerge 388can just use <c>emerge &lt;package-name&gt;</c> or <c>emerge
389&lt;category&gt;/&lt;package-name&gt;</c>. As an example we'll install 389&lt;category&gt;/&lt;package-name&gt;</c>. As an example we'll install
390<c>gnumeric</c>: 390<c>gnumeric</c>:
391</p> 391</p>
392 392
393<pre caption="Building gnumeric"> 393<pre caption="Building gnumeric">
394# <i>emerge gnumeric</i> 394# <i>emerge gnumeric</i>
395</pre> 395</pre>
396 396
397<p> 397<p>
398This will download the sourcecode for you and unpacks, compiles and installs the 398This will download the source code for you and unpacks, compiles and installs
399package on your system. It will also do the same for all the dependencies. If 399the package on your system. It will also do the same for all the dependencies.
400you want to see what dependencies will be installed with it, use the 400If you want to see what dependencies will be installed with it, use the
401<c>--pretend</c> option (<c>-p</c> in short): 401<c>--pretend</c> option (<c>-p</c> in short):
402</p> 402</p>
403 403
404<pre caption="Pretending to build gnumeric"> 404<pre caption="Pretending to build gnumeric">
405# <i>emerge --pretend gnumeric</i> 405# <i>emerge --pretend gnumeric</i>
406</pre> 406</pre>
407 407
408<p> 408<p>
409If you want to download the sourcecode of the package and its dependencies, 409If you want to download the source code of the package and its dependencies,
410but don't want to build the package, use the <c>--fetchonly</c> option 410but don't want to build the package, use the <c>--fetchonly</c> option
411(<c>-f</c> in short): 411(<c>-f</c> in short):
412</p> 412</p>
413 413
414<pre caption="Fetching sources for gnumeric"> 414<pre caption="Fetching sources for gnumeric">
415# <i>emerge --fetchonly gnumeric</i> 415# <i>emerge --fetchonly gnumeric</i>
416</pre> 416</pre>
417 417
418<p> 418<p>
419If you want to see where <c>emerge</c> downloads the sources from, combine the 419If you want to see where <c>emerge</c> downloads the sources from, combine the
420<c>--fetchonly</c> and <c>--pretend</c> options: 420<c>--fetchonly</c> and <c>--pretend</c> options:
421</p> 421</p>
422 422
423<pre caption="Showing URLs of the sources for gnumeric"> 423<pre caption="Showing URLs of the sources for gnumeric">
424# <i>emerge --fetchonly --pretend gnumeric</i> 424# <i>emerge --fetchonly --pretend gnumeric</i>
543<pre caption="Show all dependencies of gnumeric"> 543<pre caption="Show all dependencies of gnumeric">
544# <i>emerge --emptytree --pretend gnumeric</i> 544# <i>emerge --emptytree --pretend gnumeric</i>
545</pre> 545</pre>
546 546
547<p> 547<p>
548Another argument is <c>--nodeps</c>, which will ask Portage to try install the 548Another argument is <c>--nodeps</c>, which will ask Portage to try install the
549given package without taking care of the dependencies. It is trivial that this 549given package without taking care of the dependencies. It is trivial that this
550can lead to failures. 550can lead to failures.
551</p> 551</p>
552 552
553<pre caption="Installing gnumeric without taking care of the dependencies"> 553<pre caption="Installing gnumeric without taking care of the dependencies">
554# <i>emerge --nodeps gnumeric</i> 554# <i>emerge --nodeps gnumeric</i>
555</pre> 555</pre>
556 556
557<p> 557<p>
558To opposite of <c>--nodeps</c> is <c>--onlydeps</c>, which will have Portage 558The opposite of <c>--nodeps</c> is <c>--onlydeps</c>, which will have Portage
559install all dependencies of a given package, but not the package itself: 559install all dependencies of a given package, but not the package itself:
560</p> 560</p>
561 561
562<pre caption="Installing the dependencies of gnumeric"> 562<pre caption="Installing the dependencies of gnumeric">
563# <i>emerge --onlydeps gnumeric</i> 563# <i>emerge --onlydeps gnumeric</i>
564</pre> 564</pre>
565 565
566</body> 566</body>
567</subsection> 567</subsection>
568<subsection> 568<subsection>
569<title>Updating your System</title> 569<title>Updating your System</title>
570<body> 570<body>
571 571
572<p> 572<p>
573Portage knows two special tags to denote a set of software packages: 573Portage knows two special tags to denote a set of software packages:
622</p> 622</p>
623 623
624<ul> 624<ul>
625 <li> 625 <li>
626 <e>B</e> (blocks) The package listed to the left is blocking the emerge of 626 <e>B</e> (blocks) The package listed to the left is blocking the emerge of
627 the package listed to the right 627 the package listed to the right
628 </li> 628 </li>
629 <li> 629 <li>
630 <e>N</e> (new) The package is new to your system and will be emerged for the 630 <e>N</e> (new) The package is new to your system and will be emerged for the
631 first time 631 first time
632 </li> 632 </li>
633 <li> 633 <li>
634 <e>R</e> (reemerge) The package isn't new, but needs to be reemerged 634 <e>R</e> (reemerge) The package isn't new, but needs to be reemerged
635 </li> 635 </li>
636 <li> 636 <li>
637 <e>F</e> (fetch) The package requires that you download the sourcecode 637 <e>F</e> (fetch) The package requires that you download the source code
638 manually (for instance due to licencing issues) 638 manually (for instance due to licencing issues)
639 </li> 639 </li>
640 <li> 640 <li>
641 <e>U</e> (update) The package already exists on your system but will be 641 <e>U</e> (update) The package already exists on your system but will be
642 upgraded 642 upgraded
643 </li> 643 </li>
644 <li> 644 <li>
645 <e>UD</e> (downgrade) The package already exists on your system but will be 645 <e>UD</e> (downgrade) The package already exists on your system but will be
646 downgraded 646 downgraded
647 </li> 647 </li>
648 <li> 648 <li>
649 <e>U-</e> (slot warning) The package you have installed on your system 649 <e>U-</e> (slot warning) The package you have installed on your system
650 is listed as a package that can not coexist with a different version, but 650 is listed as a package that can not coexist with a different version, but
651 your update does. The update will be installed and the older version will be 651 your update does. The update will be installed and the older version will be
652 removed. 652 removed.

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20