Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:gentoo-portage [2006/12/16 01:26] cyril |
linux:gentoo-portage [2013/09/19 16:40] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
Portage is the package manager of Gentoo. | Portage is the package manager of Gentoo. | ||
+ | |||
+ | |||
+ | |||
+ | ===== How to use emerge ===== | ||
+ | |||
+ | First you have to choose if you want to use stable or unstable version. In ''/ | ||
+ | < | ||
+ | ACCEPT_KEYWORDS=" | ||
+ | ACCEPT_KEYWORDS=" | ||
+ | </ | ||
+ | |||
+ | Emerge main options : | ||
+ | |||
+ | ^ Long option ^ Short option ^ Description ^ | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | They are mainly used with : | ||
+ | <code bash> | ||
+ | emerge -[D][N]tuav # to see dependencies as a tree | ||
+ | emerge -[D][N]uav | ||
+ | emerge -Ca # to remove a package | ||
+ | emerge --sync | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== USE flags ===== | ||
+ | |||
+ | Description of USE flags : [[http:// | ||
+ | |||
+ | There are several places to modify them, which correspond to several levels of priority : | ||
+ | |||
+ | === / | ||
+ | |||
+ | Don't touch it, it will be undone when you emerge Portage. (least priority) | ||
+ | |||
+ | < | ||
+ | USE=" | ||
+ | </ | ||
+ | |||
+ | === / | ||
+ | |||
+ | Global flags used for all packages (overwrite make.defaults if conflicts). | ||
+ | |||
+ | < | ||
+ | USE=" | ||
+ | </ | ||
+ | |||
+ | Don't forget also in make.conf : | ||
+ | < | ||
+ | INPUT_DEVICES=" | ||
+ | VIDEO_CARDS=" | ||
+ | </ | ||
+ | |||
+ | === / | ||
+ | |||
+ | Here you can set flags for each package separately (overwrite make.conf if conflicts). | ||
+ | |||
+ | < | ||
+ | www-client/ | ||
+ | www-client/ | ||
+ | </ | ||
+ | |||
+ | === Environment variable === | ||
+ | |||
+ | You can set flags for one execution of emerge (overwrite all other flags if conflicts), but if you emerge again flags are not recorded (particularly if it is a dependency update). Thus you should only use it for testing flags. | ||
+ | |||
+ | < | ||
+ | USE=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Masking flags ===== | ||
+ | |||
+ | === / | ||
+ | |||
+ | < | ||
+ | ACCEPT_KEYWORDS=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | === / | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | =www-client/ | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | === / | ||
+ | |||
+ | < | ||
+ | app-cdr/ | ||
+ | =media-video/ | ||
+ | </ | ||
+ | |||
+ | === / | ||
+ | |||
+ | Contains hard masked packages by portage developpers. Do not modify it (use / | ||
===== Dealing with most problems ===== | ===== Dealing with most problems ===== | ||
Line 8: | Line 117: | ||
If emerge fails you can try : | If emerge fails you can try : | ||
- | * if you see that the error message is related to something, try to install this package before (eg opengl) | + | * if you see that the error message is related to something, try to install this package before (eg opengl). If you don't know to which package a file is related : |
+ | < | ||
+ | equery belongs < | ||
+ | </ | ||
* install manually some of the dependencies before, it changes the order and can work | * install manually some of the dependencies before, it changes the order and can work | ||
+ | * look at the USE flags for this package, and try to remove some of them, which seem explicitly related to the error, or that you they can be " | ||
+ | * downgrade to an older version, by masking it in the package.use file | ||
* if nothing works, unmerge all packages related to what you want (eg x11), or remove them from / | * if nothing works, unmerge all packages related to what you want (eg x11), or remove them from / | ||
+ | |||
+ | |||
===== Emerge step-by-step for modifying source ===== | ===== Emerge step-by-step for modifying source ===== | ||
+ | |||
+ | For example for fluxbox : | ||
<code bash> | <code bash> | ||
- | ebuild fluxbox fetch ; to download the package | + | # in / |
- | ebuild fluxbox unpack | + | ebuild fluxbox-1.0.0.ebuild |
- | ; here you can modify sources | + | ebuild fluxbox-1.0.0.ebuild |
- | ebuild fluxbox compile | + | # NOW you can modify sources |
- | ebuild fluxbox install | + | # in / |
- | ebuild fluxbox qmerge | + | # or wherever specified in make.conf |
- | ebuild fluxbox clean ; to clean temporary folders | + | ebuild fluxbox-1.0.0.ebuild |
+ | ebuild fluxbox-1.0.0.ebuild | ||
+ | ebuild fluxbox-1.0.0.ebuild | ||
+ | ebuild fluxbox-1.0.0.ebuild | ||
</ | </ | ||
+ | |||
+ | Or more simply: | ||
+ | <code bash> | ||
+ | # in / | ||
+ | ebuild fluxbox-1.0.0.ebuild fetch unpack | ||
+ | # NOW modify sources in / | ||
+ | ebuild fluxbox-1.0.0.ebuild compile install qmerge clean # to compile, install, merge and clean | ||
+ | </ | ||
+ | |||
+ | |||
+ | Then you can have to unmerge the previous version (check with '' | ||
This is exactly equivalent to : | This is exactly equivalent to : | ||
Line 29: | Line 161: | ||
</ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Emerge a package not in the portage tree ===== | ||
+ | |||
+ | You can get somewhere an ebuild. But to use it you need a Manifest file. You can create it with '' | ||
+ | < | ||
+ | ebuild name.ebuild manifest | ||
+ | </ | ||
+ | |||
+ | Then you can do the emerge step by step with ebuild as explained in the previous section, or move the ebuild in the ''/ | ||
+ | |||
+ | ==== Create the overlay ==== | ||
+ | |||
+ | Create another folder similar to ''/ | ||
+ | < | ||
+ | PORTDIR_OVERLAY="/ | ||
+ | </ | ||
+ | |||
+ | ==== Install the package in the overlay and install it ==== | ||
+ | |||
+ | For example to install xmms2 : | ||
+ | <code bash> | ||
+ | wget http:// | ||
+ | mkdir / | ||
+ | mkdir / | ||
+ | mv xmms2-0.2.7.ebuild / | ||
+ | ebuild / | ||
+ | </ | ||
+ | |||
+ | And finally, simply : | ||
+ | < | ||
+ | emerge -Duav xmms2 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Finish installing xmms2 if you really want ;-) ==== | ||
+ | |||
+ | If you really want to use xmms2, you can test it with '' | ||
+ | < | ||
+ | wget http:// | ||
+ | mkdir / | ||
+ | mv gxmms2-0.6.4.ebuild / | ||
+ | ebuild / | ||
+ | emerge -Duav gxmms2 | ||
+ | </ | ||
+ | |||
+ | You can find a list of clients for xmms2 here :\\ | ||
+ | http:// | ||
+ | |||
+ | |||
+ | ===== Manage public overlays ===== | ||
+ | |||
+ | There are some public overlays you can manage automatically. First install '' | ||
+ | |||
+ | < | ||
+ | # list available overlays | ||
+ | layman -L | ||
+ | # install an overlay | ||
+ | layman -a < | ||
+ | # sync overlays | ||
+ | layman --sync ALL | ||
+ | </ | ||
+ | |||
+ | In order to use the main gentoo tree in priority over overlays, create the file / | ||
+ | < | ||
+ | [gentoo] | ||
+ | priority = 1000 | ||
+ | </ | ||
+ | |||
+ | You can also refer to overlays in the / | ||
+ | < | ||
+ | category/ | ||
+ | category/ | ||
+ | </ | ||
===== Save an installed package ===== | ===== Save an installed package ===== | ||
Line 52: | Line 260: | ||
</ | </ | ||
+ | It is very important to make the effort to deal with config files updates, because you can lose all the changes you did in your configuration files if it is overwritten ! | ||
+ | |||
+ | Thus for each configuration file : | ||
+ | * enter its number to show the diff file | ||
+ | * look at the diff file to see if there are some configurations that you did yourself | ||
+ | * => if you didn't modify the config file, overwrite it with the update | ||
+ | * => if you modified it and there is nothing new in the update, keep your original file | ||
+ | * => if there are some new things and some things you modified, choose // | ||
===== Clean your portage folder ===== | ===== Clean your portage folder ===== | ||
Line 63: | Line 279: | ||
You can add the '' | You can add the '' | ||
+ | |||
+ | |||
===== Compiling in RAM ===== | ===== Compiling in RAM ===== | ||
- | If you have enough memory, it can be faster to compile directly in the memory instead of on the hard disk. For that, mount ''/ | + | If you have enough memory, it can be faster |
+ | < | ||
+ | none / | ||
+ | </ | ||
+ | and then : | ||
+ | < | ||
+ | mount / | ||
+ | </ | ||
+ | |||
+ | You can check with the '' | ||
+ | |||
+ | The amount of memory you mount depends on how much memory you have, and how much you need. If there is not enough mounted memory, emerge will fail and stop when there is no more memory available. But if you use more memory than available it will use the swap and as slow as before, and if you use more memory than ram+swap available, linux can have big problems. | ||
+ | |||
+ | 300MB is enough for most of packages, but for some others you need more. Here is some examples of necessary space : | ||
+ | ^ package | ||
+ | | GCC (gtk, | ||
+ | | GCC (fortran, | ||
+ | | firefox (java/-Os) | 550MB | yes | 0h30 | | | ||
+ | | thunderbird (crypt, | ||
+ | | kde | 350MB | no | | | | ||
+ | | wxGTK (X, | ||
+ | \\ | ||
+ | |||
+ | As ram is not used if the mounted ram is not used, there is no risk to always mount a great amount of memory. Even if it uses swap, it will prevent emerge from failing and won't be slower than not using mounted ram. Then you should mount the maximum of memory so that ram+swap will be enough for the normally used memory, and the mounted memory. | ||
+ | |||
+ | ===== Niceness ===== | ||
+ | |||
+ | '' | ||
===== List of gentoo packages ===== | ===== List of gentoo packages ===== | ||
- | [[http://dev.gentoo.org/ | + | Packages : [[http:// |
- | ===== eix ===== | + | Overlays packages : [[http:// |
- | '' | + | Use flags : [[http:// |
+ | |||
+ | ===== Tools ===== | ||
+ | ==== eix ==== | ||
+ | |||
+ | '' | ||
<code bash> | <code bash> | ||
eix-sync # to do an emerge --sync and synchronize its database | eix-sync # to do an emerge --sync and synchronize its database | ||
- | eix < | + | eix < |
+ | eix -S < | ||
+ | </ | ||
+ | |||
+ | Versions stable are in red, unstable are in yellow masked by '' | ||
+ | |||
+ | ==== equery ==== | ||
+ | |||
+ | To find the package that a file came from. | ||
+ | |||
+ | <code bash> | ||
+ | equery belongs < | ||
+ | </ | ||
+ | |||
+ | ==== genlop ==== | ||
+ | |||
+ | To parse portage logs and get some stats. | ||
+ | |||
+ | <code bash> | ||
+ | genlop | ||
+ | genlop -t < | ||
+ | genlop -c ; information about current merge | ||
</ | </ |