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.3 2003/11/26 20:19:59 swift Exp $ --> |
4 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.4 2003/11/27 11:08:00 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> |
14 | We have briefly encountered <c>emerge</c> in the previous chapter, but not to |
14 | We have briefly encountered <c>emerge</c> in the previous chapter, but not to |
15 | the extent that you are now able to work with it to its fullest potential. We |
15 | the extent that you are now able to work with it to its fullest potential. We |
16 | will fix that right now ;-) |
16 | will fix that right now ;-) |
17 | </p> |
17 | </p> |
18 | |
18 | |
19 | <p> |
19 | <p> |
… | |
… | |
211 | Latest version available: 3.8 |
211 | Latest version available: 3.8 |
212 | Latest version installed: 3.8 |
212 | Latest version installed: 3.8 |
213 | Size of downloaded files: 2,782 kB |
213 | Size of downloaded files: 2,782 kB |
214 | Homepage: http://www.mozilla.org/projects/security/pki/nss/ |
214 | Homepage: http://www.mozilla.org/projects/security/pki/nss/ |
215 | Description: Mozilla's Netscape Security Services Library that implements PKI support |
215 | Description: Mozilla's Netscape Security Services Library that implements PKI support |
216 | </pre> |
216 | </pre> |
217 | |
217 | |
218 | <p> |
218 | <p> |
219 | As you can see, the output of <c>emerge</c> informs you about the category and |
219 | As you can see, the output of <c>emerge</c> informs you about the category and |
220 | name of the package, the available version, the currently installed version, |
220 | name of the package, the available version, the currently installed version, |
221 | the size of the downloaded files, the homepage and the small description. |
221 | the size of the downloaded files, the homepage and the small description. |
222 | </p> |
222 | </p> |
223 | |
223 | |
224 | <p> |
224 | <p> |
225 | You see something new? Yes, <e>downloaded files</e>. When you tell Portage to |
225 | You see something new? Yes, <e>downloaded files</e>. When you tell Portage to |
226 | install a package, it ofcourse needs to have the necessary sources (or |
226 | install a package, it of course needs to have the necessary sources (or |
227 | precompiled packages) available. It therefor checks the contents of |
227 | precompiled packages) available. It therefor checks the contents of |
228 | <path>/usr/portage/distfiles</path> (for sourcecode) or |
228 | <path>/usr/portage/distfiles</path> (for sourcecode) or |
229 | <path>/usr/portage/packages/All</path> (for precompiled packages) to see if the |
229 | <path>/usr/portage/packages/All</path> (for precompiled packages) to see if the |
230 | necessary files are already available. If not, it downloads the necessary files |
230 | necessary files are already available. If not, it downloads the necessary files |
231 | and places them in those directories. |
231 | and places them in those directories. |
232 | </p> |
232 | </p> |
233 | |
233 | |
234 | <note> |
234 | <note> |
235 | Searching the Portage Tree, especially when using <c>--searchdesc</c>, is very |
235 | Searching the Portage Tree, especially when using <c>--searchdesc</c>, is very |
236 | time consuming. There are other, more performant tools available. We will |
236 | time consuming. There are other, more performant tools available. We will |
237 | describe those in the chapter on <uri link="?part=2&chap=7">Gentoolkit and |
237 | describe those in the chapter on <uri link="?part=2&chap=7">Gentoolkit and |
238 | Other Tools</uri>. |
238 | Other Tools</uri>. |
239 | </note> |
239 | </note> |
240 | |
240 | |
241 | </body> |
241 | </body> |
… | |
… | |
341 | <body> |
341 | <body> |
342 | |
342 | |
343 | <p> |
343 | <p> |
344 | Gentoo provides ebuilds, the Gentoo packages if you like. But when you want to |
344 | Gentoo provides ebuilds, the Gentoo packages if you like. But when you want to |
345 | install such an ebuild, you can choose between <e>building</e> the package, or |
345 | install such an ebuild, you can choose between <e>building</e> the package, or |
346 | using a <e>prebuild</e> package. But what are the advantages/disadvantages of |
346 | using a <e>prebuild</e> package. But what are the advantages/disadvantages of |
347 | both approaches, and can they be used next to each other? |
347 | both approaches, and can they be used next to each other? |
348 | </p> |
348 | </p> |
349 | |
349 | |
350 | <p> |
350 | <p> |
351 | As you probably have guessed, building packages takes a lot of time (especially |
351 | As you probably have guessed, building packages takes a lot of time (especially |
352 | if you have little resources or want to build big packages, such as <uri |
352 | if you have little resources or want to build big packages, such as <uri |
353 | link="http://www.kde.org">KDE</uri>, <uri |
353 | link="http://www.kde.org">KDE</uri>, <uri |
354 | link="http://www.openoffice.org">OpenOffice.org</uri>, etc.). By building the |
354 | link="http://www.openoffice.org">OpenOffice.org</uri>, etc.). By building the |
355 | package, you can use the <c>USE</c> setting to tweak the package to your system. |
355 | package, you can use the <c>USE</c> setting to tweak the package to your system. |
356 | Ofcourse, you can also define high optimization options (in the <c>CFLAGS</c> |
356 | Of course, you can also define high optimization options (in the <c>CFLAGS</c> |
357 | and <c>CXXFLAGS</c> variables) to compile the package with. |
357 | and <c>CXXFLAGS</c> variables) to compile the package with. |
358 | </p> |
358 | </p> |
359 | |
359 | |
360 | <p> |
360 | <p> |
361 | Using prebuild packages improves the installation time (as no more compilation |
361 | Using prebuild packages improves the installation time (as no more compilation |
362 | is needed), but you will lose the advantages of the <c>USE</c> setting and the |
362 | is needed), but you will lose the advantages of the <c>USE</c> setting and the |
363 | <c>CFLAGS</c> & <c>CXXFLAGS</c> variables. |
363 | <c>CFLAGS</c> & <c>CXXFLAGS</c> variables. |
364 | </p> |
364 | </p> |
365 | |
365 | |
366 | <p> |
366 | <p> |
367 | As previously stated, prebuild packages are stored in the |
367 | As previously stated, prebuild packages are stored in the |
368 | <path>/usr/portage/packages/All</path> directory, while the sourcecode of the |
368 | <path>/usr/portage/packages/All</path> directory, while the sourcecode of the |
369 | packages are placed in <path>/usr/portage/distfiles</path>. If you have finished |
369 | packages are placed in <path>/usr/portage/distfiles</path>. If you have finished |
370 | installing a package you can remove the package or sourcecode from the |
370 | installing a package you can remove the package or sourcecode from the |
371 | respective directory. However, you might want to keep the package/sourcecode of |
371 | respective directory. However, you might want to keep the package/sourcecode of |
… | |
… | |
420 | <pre caption="Showing URLs of the sources for gnumeric"> |
420 | <pre caption="Showing URLs of the sources for gnumeric"> |
421 | # <i>emerge --fetchonly --pretend gnumeric</i> |
421 | # <i>emerge --fetchonly --pretend gnumeric</i> |
422 | </pre> |
422 | </pre> |
423 | |
423 | |
424 | <p> |
424 | <p> |
425 | You can also opt to install a specific version of a package. |
425 | You can also opt to install a specific version of a package. |
426 | For instance, if you want to install a gnumeric version older than 1.2 -- for |
426 | For instance, if you want to install a gnumeric version older than 1.2 -- for |
427 | any reason whatsoever :) you would type: |
427 | any reason whatsoever :) you would type: |
428 | </p> |
428 | </p> |
429 | |
429 | |
430 | <pre caption="Installing a specific gnumeric version"> |
430 | <pre caption="Installing a specific gnumeric version"> |
431 | # <i>emerge "<gnumeric-1.2"</i> |
431 | # <i>emerge "<gnumeric-1.2"</i> |
432 | </pre> |
432 | </pre> |
433 | |
433 | |
434 | <p> |
434 | <p> |
435 | Other possibilities are ofcourse ">" (later version) and "=" (the exact |
435 | Other possibilities are of course ">" (later version) and "=" (the exact |
436 | version). |
436 | version). |
437 | </p> |
437 | </p> |
438 | |
438 | |
439 | </body> |
439 | </body> |
440 | </subsection> |
440 | </subsection> |
441 | <subsection> |
441 | <subsection> |
442 | <title>Installing Prebuild Packages</title> |
442 | <title>Installing Prebuild Packages</title> |
443 | <body> |
443 | <body> |
444 | |
444 | |
445 | <p> |
445 | <p> |
446 | When you want to install a prebuild package, you should use the <c>--usepkg</c> |
446 | When you want to install a prebuild package, you should use the <c>--usepkg</c> |
447 | option (<c>-k</c> in short). This will use the binary package available in |
447 | option (<c>-k</c> in short). This will use the binary package available in |
448 | <path>/usr/portage/packages/All</path> <e>if</e> the package and the version of |
448 | <path>/usr/portage/packages/All</path> <e>if</e> the package and the version of |
449 | the application you want to install match. |
449 | the application you want to install match. |
450 | </p> |
450 | </p> |
… | |
… | |
502 | </pre> |
502 | </pre> |
503 | |
503 | |
504 | <!-- TODO Up until here --> |
504 | <!-- TODO Up until here --> |
505 | |
505 | |
506 | <p> |
506 | <p> |
507 | You can also opt to install a specific version of a package. |
507 | You can also opt to install a specific version of a package. |
508 | For instance, if you want to install a gnumeric version older than 1.2 -- for |
508 | For instance, if you want to install a gnumeric version older than 1.2 -- for |
509 | any reason whatsoever :) you would type: |
509 | any reason whatsoever :) you would type: |
510 | </p> |
510 | </p> |
511 | |
511 | |
512 | <pre caption="Installing a specific gnumeric version"> |
512 | <pre caption="Installing a specific gnumeric version"> |
513 | # <i>emerge --usepkg "<gnumeric-1.2"</i> |
513 | # <i>emerge --usepkg "<gnumeric-1.2"</i> |
514 | </pre> |
514 | </pre> |
515 | |
515 | |
516 | <p> |
516 | <p> |
517 | Other possibilities are ofcourse ">" (later version) and "=" (the exact |
517 | Other possibilities are of course ">" (later version) and "=" (the exact |
518 | version). |
518 | version). |
519 | </p> |
519 | </p> |
520 | |
520 | |
521 | |
521 | |
522 | </body> |
522 | </body> |
523 | </subsection> |
523 | </subsection> |
524 | <subsection> |
524 | <subsection> |
525 | <title>Updating your System</title> |
525 | <title>Updating your System</title> |
526 | <body> |
526 | <body> |
527 | |
527 | |
528 | <p> |
528 | <p> |
529 | Portage knows two special tags to denote a set of software packages: |
529 | Portage knows two special tags to denote a set of software packages: |
530 | <e>system</e> and <e>world</e>. You have already seen the former while |
530 | <e>system</e> and <e>world</e>. You have already seen the former while |
531 | installing Gentoo if you didn't use a <e>stage3</e> installation. To refresh |
531 | installing Gentoo if you didn't use a <e>stage3</e> installation. To refresh |
532 | things: <e>system</e> is the collection of <e>core</e> packages, necessary to |
532 | things: <e>system</e> is the collection of <e>core</e> packages, necessary to |
… | |
… | |
608 | removed. |
608 | removed. |
609 | </li> |
609 | </li> |
610 | </ul> |
610 | </ul> |
611 | |
611 | |
612 | <p> |
612 | <p> |
613 | In certain cases, an update may mean a downgrade (i.e. install an older version |
613 | In certain cases, an update may mean a downgrade (i.e. install an older version |
614 | instead of a newer version). If you don't want this to happen, use the |
614 | instead of a newer version). If you don't want this to happen, use the |
615 | <c>--upgradeonly</c> option (<c>-U</c> in short): |
615 | <c>--upgradeonly</c> option (<c>-U</c> in short): |
616 | </p> |
616 | </p> |
617 | |
617 | |
618 | <pre caption="Upgrading your entire system"> |
618 | <pre caption="Upgrading your entire system"> |
619 | # <i>emerge --update --upgradeonly world</i> |
619 | # <i>emerge --update --upgradeonly world</i> |
620 | </pre> |
620 | </pre> |
621 | |
621 | |
622 | <p> |
622 | <p> |
623 | Ofcourse, we are talking here about <e>system</e> and <e>world</e>, but you can |
623 | Of course, we are talking here about <e>system</e> and <e>world</e>, but you can |
624 | perform the same actions for individual software packages. |
624 | perform the same actions for individual software packages. |
625 | </p> |
625 | </p> |
626 | |
626 | |
627 | </body> |
627 | </body> |
628 | </subsection> |
628 | </subsection> |
629 | <subsection> |
629 | <subsection> |
630 | <title>Removing Software</title> |
630 | <title>Removing Software</title> |
631 | <body> |
631 | <body> |
632 | |
632 | |
633 | <p> |
633 | <p> |
634 | If you want to remove software from your system, you can use the <c>unmerge</c> |
634 | If you want to remove software from your system, you can use the <c>unmerge</c> |
635 | option (<c>-C</c> - capital C - in short): |
635 | option (<c>-C</c> - capital C - in short): |
636 | </p> |
636 | </p> |
637 | |
637 | |
638 | <pre caption="Uninstalling software"> |
638 | <pre caption="Uninstalling software"> |