Gentoo Wiki


This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other



On servers you generally don't want graphical programs installed. Unfortunately the normal profile includes a number of USE flags that you have to bother to turn off. The purpose of this tip is to ensure you turn them all off.

2006.1 Server Specific Profile

As of 2006.1, Gentoo introduces separate sub-profiles for desktop and server set ups. As of the beginning of September 2006 this profile is not yet officially supported.

If you want to examine the differences between the profiles for yourself, you can go to /usr/portage/default-linux/(arch)/2006.1/ and examine (with a text editor) the differences between the files in the server and desktop sub-directories.

Replace '(arch) is your architecture - if you're not sure what this is, run the following and see what the current setting is:

 ls -ald /etc/make.profile

Note that you should never edit the portage profile directly as your changes will be lost next time you run emerge --sync. You should use /etc/portage for this purpose - see "man portage" and the Working with Gentoo and Working with Portage sections of the Gentoo Handbook for further information.

All you need to do to use the server specific profile is to change your profile as follows:

 cd /etc
 rm make.profile
 ln -s ../usr/portage/profiles/default-linux/(arch)/2006.1/server make.profile

Note: Activating the server subprofile may result in a long message about it not being supported after every package merge. To turn this off, you can add the following line to your make.conf file:


Alternative Method

To prevent emerge from pulling in unwanted X related packages we'll use the -* USE flag. The -* disables all default USE flags, however all USE flag flags defined after the -* will be honored. This will require better USE flag management then perhaps you have been doing in the past, nevertheless you should be doing this for servers anyway.

WARNING: Using -* will deactivate ALL USE flags - this could disable features that you or other programs are expecting to be available. For example, the bzip2 flag adds bzip2 (.tbz2/.tar.bzip2) support to tar. You may also lose important changes that occur when you update your profile.

emerge --info | grep USE= 

Take the resulting output as your USE flag base for /etc/make.conf, then append -* to USE= like this...


For clarity I usually do it like this....

USE="-* -X -kde -gnome -gtk -gtk2 -qt -qt3 -qt4 -arts -cups -alsa -arts 

You'll have to tweak the remaining USE flags to your specific needs and thus ending with USE looking something like this...

USE="-* -X -kde -gnome -gtk -gtk2 -qt -qt3 -qt4 -arts -cups -alsa -arts x86 apache2
     bash-completion bcmath berkdb calendar cdr crypt dba dga dvd
     fortran ftp gd gif gpm imap jpeg ldap libwww maildir mmx mpm-prefork
     mysql ncurses nls pam perl php png python readline sasl sdl session
     slang spell ssl tclck tcpd usb vhosts xml xml2 zlib elibc_glibc
     kernel_linux userland_GNU"

See Also

Retrieved from ""

Last modified: Wed, 26 Dec 2007 14:37:00 +0000 Hits: 9,244