| … | |
… | |
| 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/1.0 --> |
5 | <!-- See http://creativecommons.org/licenses/by-sa/1.0 --> |
| 6 | |
6 | |
| 7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.19 2004/01/09 10:52:18 dertobi123 Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-portage.xml,v 1.34 2004/08/28 11:30:43 swift Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
| 10 | <section> |
10 | <section> |
| 11 | <title>Obtaining Package Information</title> |
11 | <title>Obtaining Package Information</title> |
| 12 | <subsection> |
12 | <subsection> |
| … | |
… | |
| 90 | dev-lisp/ gnome-extra/ net-p2p/ |
90 | dev-lisp/ gnome-extra/ net-p2p/ |
| 91 | </pre> |
91 | </pre> |
| 92 | |
92 | |
| 93 | <p> |
93 | <p> |
| 94 | As you can see, the Portage tree has several subdirectories. Most of them are |
94 | As you can see, the Portage tree has several subdirectories. Most of them are |
| 95 | the <e>categories</e> in which the Gentoo packages, called <e>ebuilds</e>, |
95 | the <e>categories</e> in which the Gentoo packages reside. Take a look at, for |
| 96 | reside. Take a look at, for instance, <path>app-office</path>: |
96 | instance, <path>app-office</path>: |
| 97 | </p> |
97 | </p> |
| 98 | |
98 | |
| 99 | <pre caption="Viewing a category"> |
99 | <pre caption="Viewing a category"> |
| 100 | # <i>cd app-office; ls --classify</i> |
100 | # <i>cd app-office; ls --classify</i> |
| 101 | abiword/ gnotime/ kmymoney2/ ooodi/ plan/ timestamp.x |
101 | abiword/ gnotime/ kmymoney2/ ooodi/ plan/ timestamp.x |
| … | |
… | |
| 117 | ChangeLog files/ openoffice-1.0.3-r1.ebuild openoffice-1.1.0-r2.ebuild |
117 | ChangeLog files/ openoffice-1.0.3-r1.ebuild openoffice-1.1.0-r2.ebuild |
| 118 | Manifest metadata.xml openoffice-1.1.0-r1.ebuild openoffice-1.1.0.ebuild |
118 | Manifest metadata.xml openoffice-1.1.0-r1.ebuild openoffice-1.1.0.ebuild |
| 119 | </pre> |
119 | </pre> |
| 120 | |
120 | |
| 121 | <p> |
121 | <p> |
| 122 | Remember that we told you that a Gentoo package is called an ebuild? Well, in |
122 | In the example directory, four ebuilds are stored. An <e>ebuild</e> is a script |
| 123 | the example directory four of such ebuilds are stored. Their naming is |
123 | which contains all the necessary information about a specific version of a |
| 124 | almost identical: they only differ in the version name. |
124 | package. The naming for the ebuilds is almost identical; they only differ in |
|
|
125 | the version name. |
| 125 | You are free to view the contents of such a package: they are plain scripts. We |
126 | You are free to view the contents of such an ebuild: they are plain scripts. We |
| 126 | will not discuss it right now as it isn't important to know if you plan on just |
127 | will not discuss it right now as it isn't important to know if you plan on just |
| 127 | using Gentoo. |
128 | using Gentoo. |
| 128 | </p> |
129 | </p> |
| 129 | |
130 | |
| 130 | <p> |
131 | <p> |
| 131 | The other files are the <path>ChangeLog</path> (which contains a listing of all |
132 | The other files are the <path>ChangeLog</path> (which contains a listing of all |
| 132 | the changes done to the ebuilds), <path>Manifest</path> (which contains the |
133 | the changes done to the ebuilds), <path>Manifest</path> (which contains the |
| 133 | checksums and permissions of all the files in the directory) and |
134 | checksums and filesizes of all the files in the directory) and |
| 134 | <path>metadata.xml</path> (which contains more information about the package, |
135 | <path>metadata.xml</path> (which contains more information about the package, |
| 135 | such as the responsible development group -- called <e>herd</e> -- and a more |
136 | such as the responsible development group -- called <e>herd</e> -- and a more |
| 136 | extensive description). |
137 | extensive description). |
| 137 | </p> |
138 | </p> |
| 138 | |
139 | |
| 139 | <p> |
140 | <p> |
| 140 | Inside the <path>files</path> directory you will find extra files, needed by |
141 | Inside the <path>files</path> directory, you will find extra files, needed by |
| 141 | Portage: digests (checksums and permissions of the files needed by a single |
142 | Portage: digests (names, sizes and checksums of the files needed by a single |
| 142 | version of the package), patches, example configuration files, etc. |
143 | version of the package), patches, example configuration files, etc. |
| 143 | </p> |
144 | </p> |
| 144 | |
145 | |
| 145 | <pre caption="Viewing the extra files"> |
146 | <pre caption="Viewing the extra files"> |
| 146 | # <i>cd files; ls --classify</i> |
147 | # <i>cd files; ls --classify</i> |
| … | |
… | |
| 153 | nptl.patch |
154 | nptl.patch |
| 154 | </pre> |
155 | </pre> |
| 155 | |
156 | |
| 156 | <p> |
157 | <p> |
| 157 | If you go back to the root of the Portage tree (<path>/usr/portage</path>) you |
158 | If you go back to the root of the Portage tree (<path>/usr/portage</path>) you |
| 158 | will notice that there are other, non-category directories too. We will discuss |
159 | will notice that there are other, non-category directories, too. We will discuss |
| 159 | those later in this chapter. |
160 | those later in this chapter. |
| 160 | </p> |
161 | </p> |
| 161 | |
162 | |
| 162 | </body> |
163 | </body> |
| 163 | </subsection> |
164 | </subsection> |
| … | |
… | |
| 227 | |
228 | |
| 228 | <p> |
229 | <p> |
| 229 | You see something new? Yes, <e>downloaded files</e>. When you tell Portage to |
230 | You see something new? Yes, <e>downloaded files</e>. When you tell Portage to |
| 230 | install a package, it of course needs to have the necessary sources (or |
231 | install a package, it of course needs to have the necessary sources (or |
| 231 | precompiled packages) available. It therefore checks the contents of |
232 | precompiled packages) available. It therefore checks the contents of |
| 232 | <path>/usr/portage/distfiles</path> (for source code) or |
233 | <path>/usr/portage/distfiles</path> to see if the necessary files are already |
| 233 | <path>/usr/portage/packages/All</path> (for precompiled packages) to see if the |
234 | available. If not, it downloads the necessary files and places them in that |
| 234 | necessary files are already available. If not, it downloads the necessary files |
235 | directory. |
| 235 | and places them in those directories. |
|
|
| 236 | </p> |
236 | </p> |
| 237 | |
|
|
| 238 | <!-- |
|
|
| 239 | <note> |
|
|
| 240 | Searching the Portage Tree, especially when using <c>- -searchdesc</c>, is very |
|
|
| 241 | time consuming. There are other, more performant tools available. We will |
|
|
| 242 | describe those in the chapter on <uri link="?part=2&chap=7">Gentoolkit and |
|
|
| 243 | Other Tools</uri>. |
|
|
| 244 | </note> |
|
|
| 245 | --> |
|
|
| 246 | |
237 | |
| 247 | </body> |
238 | </body> |
| 248 | </subsection> |
239 | </subsection> |
| 249 | <subsection> |
240 | <subsection> |
| 250 | <title>Viewing the ChangeLog</title> |
241 | <title>Viewing the ChangeLog</title> |
| … | |
… | |
| 485 | If you don't have the prebuilt package on your system yet, you can have |
476 | If you don't have the prebuilt package on your system yet, you can have |
| 486 | <c>emerge</c> download it from a mirror, defined in the <c>PORTAGE_BINHOST</c> |
477 | <c>emerge</c> download it from a mirror, defined in the <c>PORTAGE_BINHOST</c> |
| 487 | variable declared in <path>/etc/make.conf</path>. |
478 | variable declared in <path>/etc/make.conf</path>. |
| 488 | </p> |
479 | </p> |
| 489 | |
480 | |
|
|
481 | <note> |
|
|
482 | Gentoo does not have any server or mirror containing such prebuilt packages. |
|
|
483 | Portage has been extended with this feature to fullfil the community request. |
|
|
484 | </note> |
|
|
485 | |
| 490 | <p> |
486 | <p> |
| 491 | To download the binary package in case this package doesn't exist on |
487 | To download the binary package in case this package doesn't exist on |
| 492 | your system already, use <c>--getbinpkg</c> (<c>-g</c> in short): |
488 | your system already, use <c>--getbinpkg</c> (<c>-g</c> in short): |
| 493 | </p> |
489 | </p> |
| 494 | |
490 | |
| … | |
… | |
| 550 | <p> |
546 | <p> |
| 551 | For instance, if you want Portage to pretend that none of the dependencies of a |
547 | For instance, if you want Portage to pretend that none of the dependencies of a |
| 552 | package are installed, you can use <c>--emptytree</c> (<c>-e</c> in short). This |
548 | package are installed, you can use <c>--emptytree</c> (<c>-e</c> in short). This |
| 553 | is useful with <c>--pretend</c> to display a complete tree of dependencies for |
549 | is useful with <c>--pretend</c> to display a complete tree of dependencies for |
| 554 | any particular package. Without <c>--pretend</c>, <c>emerge</c> will (re)compile |
550 | any particular package. Without <c>--pretend</c>, <c>emerge</c> will (re)compile |
| 555 | all listed packages. However, <c>glibc</c> will <e>not</e> be listed as |
551 | all listed packages. |
| 556 | dependency for safety reasons. |
|
|
| 557 | </p> |
552 | </p> |
| 558 | |
553 | |
| 559 | <pre caption="Show all dependencies of gnumeric"> |
554 | <pre caption="Show all dependencies of gnumeric"> |
| 560 | # <i>emerge --emptytree --pretend gnumeric</i> |
555 | # <i>emerge --emptytree --pretend gnumeric</i> |
| 561 | </pre> |
556 | </pre> |
| … | |
… | |
| 575 | install all dependencies of a given package, but not the package itself: |
570 | install all dependencies of a given package, but not the package itself: |
| 576 | </p> |
571 | </p> |
| 577 | |
572 | |
| 578 | <pre caption="Installing the dependencies of gnumeric"> |
573 | <pre caption="Installing the dependencies of gnumeric"> |
| 579 | # <i>emerge --onlydeps gnumeric</i> |
574 | # <i>emerge --onlydeps gnumeric</i> |
|
|
575 | </pre> |
|
|
576 | |
|
|
577 | <p> |
|
|
578 | When you uninstall software Portage will not automatically unmerge the |
|
|
579 | dependencies that aren't needed anymore. If you want to "clean" your system from |
|
|
580 | those orphaned dependencies, you can use <c>emerge depclean</c>. This will |
|
|
581 | search for all installed software that you haven't installed explicitly and that |
|
|
582 | isn't a dependency of software that you have installed explicitly. |
|
|
583 | </p> |
|
|
584 | |
|
|
585 | <warn> |
|
|
586 | Using depclean can seriously impair your system. Use with caution and |
|
|
587 | double-check the list of dependencies that Portage wants to remove before you go |
|
|
588 | ahead! |
|
|
589 | </warn> |
|
|
590 | |
|
|
591 | <pre caption="Listing and removing the orphaned dependencies"> |
|
|
592 | # <i>emerge -p depclean</i> |
|
|
593 | <comment>(After seriously verifying the list, remove the orphaned dependencies)</comment> |
|
|
594 | # <i>emerge depclean</i> |
| 580 | </pre> |
595 | </pre> |
| 581 | |
596 | |
| 582 | </body> |
597 | </body> |
| 583 | </subsection> |
598 | </subsection> |
| 584 | <subsection> |
599 | <subsection> |
| … | |
… | |
| 645 | <li> |
660 | <li> |
| 646 | <e>N</e> (new) The package is new to your system and will be emerged for the |
661 | <e>N</e> (new) The package is new to your system and will be emerged for the |
| 647 | first time |
662 | first time |
| 648 | </li> |
663 | </li> |
| 649 | <li> |
664 | <li> |
| 650 | <e>R</e> (reemerge) The package isn't new, but needs to be reemerged |
665 | <e>R</e> (replace) The package isn't new, but will be reemerged |
| 651 | </li> |
666 | </li> |
| 652 | <li> |
667 | <li> |
| 653 | <e>F</e> (fetch) The package requires that you download the source code |
668 | <e>F</e> (fetch) The package requires that you download the source code |
| 654 | manually (for instance due to licencing issues) |
669 | manually (for instance due to licencing issues) |
| 655 | </li> |
670 | </li> |
| … | |
… | |
| 659 | </li> |
674 | </li> |
| 660 | <li> |
675 | <li> |
| 661 | <e>UD</e> (downgrade) The package already exists on your system but will be |
676 | <e>UD</e> (downgrade) The package already exists on your system but will be |
| 662 | downgraded |
677 | downgraded |
| 663 | </li> |
678 | </li> |
| 664 | <li> |
|
|
| 665 | <e>U-</e> (slot warning) The package you have installed on your system |
|
|
| 666 | is listed as a package that can not coexist with a different version, but |
|
|
| 667 | your update does. The update will be installed and the older version will be |
|
|
| 668 | removed. |
|
|
| 669 | </li> |
|
|
| 670 | </ul> |
679 | </ul> |
| 671 | |
680 | |
| 672 | <p> |
681 | <p> |
| 673 | In certain cases, an update may mean a downgrade (i.e. install an older version |
682 | We have mentioned that the <e>world</e> file doesn't contain dependencies. When |
| 674 | instead of a newer version). If you don't want this to happen, use the |
683 | you run <c>emerge --update world</c> only the packages mentioned in the |
| 675 | <c>--upgradeonly</c> option (<c>-U</c> in short): |
684 | <e>world</e> file and it's immediate dependencies are checked and, if necessary, |
|
|
685 | upgraded. If you want <c>emerge</c> to check <e>all</e> the dependencies |
|
|
686 | (including the dependencies of the dependencies), add the <c>--deep</c> flag: |
| 676 | </p> |
687 | </p> |
| 677 | |
688 | |
| 678 | <pre caption="Upgrading your entire system"> |
689 | <pre caption="Upgrading your entire system, including all dependencies"> |
| 679 | # <i>emerge --update --upgradeonly world</i> |
690 | # <i>emerge --update --deep world</i> |
| 680 | </pre> |
691 | </pre> |
| 681 | |
692 | |
| 682 | <p> |
693 | <p> |
| 683 | Of course, we are talking here about <e>system</e> and <e>world</e>, but you can |
694 | Of course, we are talking here about <e>system</e> and <e>world</e>, but you can |
| 684 | perform the same actions for individual software packages. |
695 | perform the same actions for individual software packages. |
| … | |
… | |
| 740 | |
751 | |
| 741 | </body> |
752 | </body> |
| 742 | </subsection> |
753 | </subsection> |
| 743 | </section> |
754 | </section> |
| 744 | <section> |
755 | <section> |
| 745 | <title>Software Availability</title> |
756 | <title>Working with Masked Packages</title> |
| 746 | <subsection> |
757 | <subsection> |
| 747 | <title>ARCH or not?</title> |
758 | <title>ARCH or not?</title> |
| 748 | <body> |
759 | <body> |
| 749 | |
760 | |
| 750 | <p> |
761 | <p> |
| … | |
… | |
| 761 | to <e>ARCH</e> after being bugfree for a sufficient amount of time. |
772 | to <e>ARCH</e> after being bugfree for a sufficient amount of time. |
| 762 | </p> |
773 | </p> |
| 763 | |
774 | |
| 764 | <p> |
775 | <p> |
| 765 | Your system will use <e>ARCH</e> packages per default. If you want to live on |
776 | Your system will use <e>ARCH</e> packages per default. If you want to live on |
| 766 | the edge, don't mind having a broken package once in a while, and you like |
777 | the edge, don't mind having a broken package once in a while, know how to deal |
| 767 | submitting bugreports to <uri |
778 | with a broken system and you like submitting bugreports to <uri |
| 768 | link="http://bugs.gentoo.org">bugs.gentoo.org</uri>, then you can opt to use |
779 | link="http://bugs.gentoo.org">bugs.gentoo.org</uri>, then you can opt to use |
| 769 | <e>~ARCH</e> packages. To "move" your system to a <e>~ARCH</e>-using system, |
780 | <e>~ARCH</e> packages. To "move" your system to a <e>~ARCH</e>-using system, |
| 770 | edit the <c>ACCEPT_KEYWORDS</c> variable in <path>/etc/make.conf</path> so that |
781 | edit the <c>ACCEPT_KEYWORDS</c> variable in <path>/etc/make.conf</path> so that |
| 771 | it reads <e>~ARCH</e> (again: for x86-based systems: <e>~x86</e>, etc.). |
782 | it reads <e>~ARCH</e> (again: for x86-based systems: <e>~x86</e>, etc.). |
| 772 | </p> |
783 | </p> |
| 773 | |
784 | |
| 774 | <p> |
785 | <p> |
|
|
786 | Note though that it is far from trivial (if even impossible) to go back to |
|
|
787 | <e>ARCH</e> from <e>~ARCH</e>. |
|
|
788 | </p> |
|
|
789 | |
|
|
790 | <p> |
| 775 | If you want to update your system now, you will notice that <e>a lot</e> of |
791 | If you want to update your system now, you will notice that <e>a lot</e> of |
| 776 | packages will be updated! |
792 | packages will be updated! |
| 777 | </p> |
793 | </p> |
| 778 | |
794 | |
| 779 | </body> |
795 | </body> |
| … | |
… | |
| 790 | Calculating dependencies |
806 | Calculating dependencies |
| 791 | !!! <comment>all ebuilds that could satisfy </comment><your package><comment> have been masked.</comment> |
807 | !!! <comment>all ebuilds that could satisfy </comment><your package><comment> have been masked.</comment> |
| 792 | </pre> |
808 | </pre> |
| 793 | |
809 | |
| 794 | <p> |
810 | <p> |
| 795 | A package can be masked due to two reasons: |
811 | A package can be masked due to several reasons: |
| 796 | </p> |
812 | </p> |
| 797 | |
813 | |
| 798 | <ol> |
814 | <ol> |
| 799 | <li>The package is in <e>~ARCH</e> while you use <e>ARCH</e></li> |
815 | <li>The package is in <e>~ARCH</e> while you use <e>ARCH</e></li> |
| 800 | <li>The package is hard-masked explicitly</li> |
816 | <li>The package is hard-masked explicitly</li> |
|
|
817 | <li>The package isn't available for your ARCH entirely</li> |
|
|
818 | <li>The package is masked by your profile</li> |
| 801 | </ol> |
819 | </ol> |
| 802 | |
820 | |
| 803 | <p> |
821 | <p> |
| 804 | If the package is masked because of the first reason, and you <e>really</e> want |
822 | If the package is masked because of the first reason, and you <e>really</e> |
| 805 | to install it (knowing that there <e>is</e> a reason why it isn't available in |
823 | want to install it (knowing that there <e>is</e> a reason why it isn't |
| 806 | <e>ARCH</e>), you can temporarily accept <e>~ARCH</e> packages: |
824 | available in <e>ARCH</e>), you can accept the <e>~ARCH</e> version of any |
|
|
825 | package by adding it to your <path>/etc/portage/package.keywords</path> file: |
| 807 | </p> |
826 | </p> |
| 808 | |
827 | |
| 809 | <pre caption="Temporarily accepting ~ARCH packages"> |
828 | <pre caption="Accepting the ~ARCH version of a package"> |
| 810 | # <i>ACCEPT_KEYWORDS="~x86" emerge gnumeric</i> |
829 | <comment>(Create the /etc/portage directory if it doesn't exist yet)</comment> |
|
|
830 | # <i>mkdir /etc/portage</i> |
|
|
831 | |
|
|
832 | # <i>echo "app-office/gnumeric ~x86" >> /etc/portage/package.keywords</i> |
|
|
833 | # <i>emerge gnumeric</i> |
| 811 | </pre> |
834 | </pre> |
| 812 | |
835 | |
| 813 | <p> |
836 | <p> |
| 814 | A package is hardmasked if it is listed in |
837 | A package is hardmasked if it is listed in |
| 815 | <path>/usr/portage/profiles/package.mask</path>. If you read this file, you |
838 | <path>/usr/portage/profiles/package.mask</path>. If you read this file, you |
| … | |
… | |
| 819 | "breaks other packages", or "badly needs testing"), create the |
842 | "breaks other packages", or "badly needs testing"), create the |
| 820 | <path>/etc/portage/package.unmask</path> file and list the package in it (use |
843 | <path>/etc/portage/package.unmask</path> file and list the package in it (use |
| 821 | the same format as is used in <path>/usr/portage/profiles/package.mask</path>). |
844 | the same format as is used in <path>/usr/portage/profiles/package.mask</path>). |
| 822 | </p> |
845 | </p> |
| 823 | |
846 | |
|
|
847 | <pre caption="Unmasking a hard-masked application"> |
|
|
848 | <comment>(Create the /etc/portage directory if it doesn't exist yet)</comment> |
|
|
849 | # <i>mkdir /etc/portage</i> |
|
|
850 | |
|
|
851 | # <i>echo "=app-office/gnumeric-1.2.12" >> /etc/portage/package.unmask</i> |
|
|
852 | </pre> |
|
|
853 | |
| 824 | <p> |
854 | <p> |
| 825 | Do <e>not</e> alter the <path>/usr/portage/profiles/package.mask</path> file as |
855 | Do <e>not</e> alter the <path>/usr/portage/profiles/package.mask</path> file as |
| 826 | all changes are undone the next time you update your Portage tree. If you want |
856 | all changes are undone the next time you update your Portage tree. |
|
|
857 | </p> |
|
|
858 | |
|
|
859 | <p> |
|
|
860 | Sometimes you might want to hardmask a (collection of) package(s). This is the |
|
|
861 | case when newer versions of an application don't support something you require |
|
|
862 | or when these versions break something else in your environment. |
|
|
863 | </p> |
|
|
864 | |
|
|
865 | <p> |
| 827 | to hardmask a package create <path>/etc/portage/package.mask</path> and list the |
866 | To hard-mask a package, create <path>/etc/portage/package.mask</path> and list the |
| 828 | package in it (use the same format as mentioned above). |
867 | package in it (use the same format as mentioned above). |
| 829 | </p> |
868 | </p> |
| 830 | |
869 | |
| 831 | <p> |
870 | <pre caption="Hard-masking a package"> |
| 832 | Another trick to circumvent the "masked package" problem is to install the |
871 | <comment>(Create the /etc/portage directory if it doesn't exist yet)</comment> |
| 833 | package using the full path. This will ignore both the <c>ACCEPT_KEYWORD</c> |
872 | # <i>mkdir /etc/portage</i> |
| 834 | settings and the <path>package.mask</path> listing. |
|
|
| 835 | </p> |
|
|
| 836 | |
873 | |
| 837 | <pre caption="Installing a package without checking for stadium / masking"> |
874 | # <i>echo ">app-office/gnumeric-1.2.10" >> /etc/portage/package.mask</i> |
| 838 | # <i>emerge /usr/portage/app-office/gnumeric/gnumeric-1.2.0.ebuild</i> |
|
|
| 839 | </pre> |
875 | </pre> |
| 840 | |
876 | |
| 841 | </body> |
877 | </body> |
| 842 | </subsection> |
878 | </subsection> |
| 843 | <subsection> |
879 | <subsection> |