From Alessandro's Wiki
  • Gentoo Linux

bla bla

  • Gentoo Linux
    benefits and reasons, why do I use it:
  • I have it installed only on my main computer at home. Not at workplace.
  • every new or updating package, has to be done running through its internal parts. VLC for example could be compiled to support only a video/audio codec or visual interface.
  • gives me an historical-technical view of the open-source evolution and its communities interactions.

Gestione de Software e repositori (portage)

  • Il comando per lavorare sul software installao/installabile di Gentoo è emerge.

Portage Overlays

Un Portage overlay serve ad estendere il portage ufficiale di gentoo: Si imposta dichiarando e assognando gli la/le directory addizionali alla variabile in make.conf


nel file

  • Si possono aggiungere rami al protage anche con layman.
layman -L list
* bangert                   [Subversion] (source:
* cell                      [Subversion] (source:
* chtekk-apps
 for i in /var/db/pkg/*/*; do if ! grep gentoo $i/repository >/dev/null; then echo -e "`basename $i`\t`cat $i/repository`"; fi; done


  • il sistema è un po complesso ma molto efficace e personalizzabile: tutti i pacchetti hanno dei tipi di versione; stable, unstable, masked e hard masked

Unstable packages

  • to mask ..
  • or, if you have it in directory structure,

Masked packages

  • to unmask a package, add its atom in
  • to mask ..

License Masked

!!! The following installed packages are masked:
- dev-java/blackdown-jdk- (masked by: sun-bcla-java-vm license(s))
  • to accept all licences, add:

to /etc/make.conf

emerge command

  • Aggiornare tutto il sistema

questi comandi calcolano le dipendenze e ci mostrano gli aggiornamenti, senza installare niente

emerge --deep --update -pvt world
emerge --deep --update -pvt system
  • se tutto va bene, aggiorniamo.
emerge --deep --update world
emerge --deep --update system
emerge --update --newuse --deep @world  --with-bdeps y -pvt
  • this option will do emerge skip packages that not compile
emerge --keep-going 
  • manual command line version of the "keep-going" option ...
emerge <options> world || until emerge --resume --skipfirst; do :; done
  • Or
while true; do emerge --resume --skipfirst && break; done 
  • or
while true; do read a; ( [ $a == "q" ] || [ $a == "x" ] ) && break; done


  • Rebuild broken connection between packages
revdep-rebuild -p

eix utility

  • list all packages installed:
  • list in compact mode
eix -c
  • list installed packages from a given overlay
eix -I --installed-from-overlay OVERLAY_NAME

USE Flags

  • Use flags are words associated to a package controlling its composing parts and the interaction with other packages.
    • example use flag:

Will enable the inclusion of bluetooth support in all the applications compiled into the system.


Will instead disable the support for all packages.

globals (all system)

  • A global use flag, to say it poorly, is the one you set only once and has effect on all the packages in your system.

You can set it in the (VIF) file


locals (package)

documentation of each local flag is in the file /usr/portage/profiles/use.local.desc

script "comodo" to check use flags

  • see also

Script gentoo use flags

  • restituisce le use definite globalmente, prima descrivendone una per una
poi tutte su una riga, togliendo quelle non trovate nel use.desc ( $USEfile ).
    • Output
    • use_name - Use description
    • NOT> use_name - Use description Use Negata, ovvero con il segno "-" davanti. es. -kde , -gnome
    • ! use_name --> Use flag NOT FOUND ! Use non trovata nel file /usr/portage/profiles/use.desc

 . /etc/make.conf
 if ! [ "x$1" == "x" ] 
 then USES="$1"
 else USES=$USE; fi
 for thisuse in $USES; do
        ABSflag=`echo $thisuse|sed -e s/-//`
        # echo ">> Use Flag [ $a ] "
        if ( `grep -q ^$ABSflag $USEfile` )
                [ "$ABSflag" == "$thisuse"  ] || desc="NOT> "
                desc="$desc "`grep "^$ABSflag" $USEfile`
                newuses="$newuses $thisuse"
                desc="!$ABSflag --> Use flag NOT FOUND !" ;   fi
        echo $desc
 echo "newuses:  $newuses"
  • mad 'questa use aggiunge il supporto per mpeg2 audio, xile-lib per esempio'

equery command

  • get package name from give file (with full path)
equery b /path/to/the/file
  • get packages depending on given package, it also guess wich use flag pulls it.
equery d package-name

ebuild command

  • if you have an .ebuild package to push into the portage, you can do it with this command.
ebuild beautiful-program-0.1.ebuild digest
  • then install the package
emerge beautiful-program

if you don't know what it means, just forget it

creating an ebuild for a new package

Installare un programma che non è nel portage, con un .ebuild:

  • La prima cosa è creare una directory, stile portage, dove copiare il file .ebuild del programma da installare:

come esempio userò il pacchetto "media-soud/xmms2":

vi /etc/make.conf

con la variabile


specifico uno o + (separati da spazi) portage addizionali. Quindi aggiungo in coda a make.conf questa linea (se non c'è già, in quel caso alcuni passi si possono saltare)


creo la directory (portebbe già esistere)

mkdir -p /usr/local/portage/

ci entro

cd /usr/local/portage/

creo la directory per xmms.

mkdir -p media-sound/xmms2/ entro

cd media-sound/xmms2/

scarico l' ebuild

  • ora con il comando ebuild e il parametro "digest", lo facciamo "digerire" al sistema.
ebuild xmms2-0.2.7.ebuild digest

io uso eix per sfogliare il repositorio, comunque il pacchetto xmms2 ora è pronto per essere emerg-ato.

emerge -pvtD xmms2

e infine

emerge xmms2

cleaning up the system (brute way)

eclean-dist --destructive
  • portage temp files: 'be very careful with this commands, they DESTROY everywhere they go
  1. first upgrade the system, repair all broken dependencies with revdep-rebuild.
  2. then cd to /var/tmp and purge temporary files
 cd /var/tmp 
 rm -rf portage/* ccache/* binpkgs/* genkernel/*

... It's not working

  • 99% of the times when something does not work on Gentoo linux is because some broken link between packages/applications. And at these times, the 99% of the times the solution is to re-compile (re-emerge) the package.

the mouse/keyboard does not work anymore

emerge -1 x11-drivers/xf86-input-evdev

... or whatever...

Kernel management

  • get a list of available vanilla sources from
eix sys-kernel/git-sources
  • get available gentoo patched kernel:
eix sys-kernel/gentoo-sources
emerge -D sys-kernel/git-sources