One of the common questions that we see from Gentoo users
is "where are my environment variables, and what are they set to?".
To understand this question, first we have to know what an environment
variable is. An environment variable is set whenever the
Variable | Function |
---|---|
This is an example of a 00basic file. This just gives you an idea of what
it looks like. If your
# /etc/env.d/00basic: # /home/cvsroot/gentoo-src/rc-scripts/etc/env.d/00basic,v 1.11 2003/02/17 02:48:39 azarah Exp $ PATH="/usr/local/bin:/opt/bin" ROOTPATH="/usr/local/bin:/opt/bin" LDPATH="/usr/local/lib" MANPATH="/usr/share/man:/usr/local/share/man" INFODIR="/usr/share/info" INFOPATH="/usr/share/info" CVS_RSH="ssh" PAGER="/usr/bin/less" LESSOPEN="|lesspipe.sh %s"
The files inside of
# This is a comment, just like BASH VARIABLE1=/path/to/something# Some of the variables can have : delimited arguments. VAR1A=/path/to/something:/path/to/another/something VARIABLE2=name_something
There are some special variables that are included in
Variable | Function |
---|---|
Alright, so now that I have defined everything, you are probably wondering what in the world this has to do with you and your Gentoo machine. The power of env.d is the power that you can change these variables to whatever you need them to be. With the definitions above, hopefully you will be able to do this.
Since we have a handle on what is going on, it is time to explain what happens
to these variables. When
Since these variables are now linked together, it is important to note where they are stored.
LDPATH ----> /etc/ld.so.conf CONFIG_PROTECT and CONFIG_PROTECT_MASK ----> /etc/profile.env (as exported variable) Specials and Others ----> /etc/profile.env
If you look at
# ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2 /usr/lib/opengl/nvidia/lib /usr/lib/mozilla /usr/X11R6/lib /opt/blackdown-jdk-1.3.1/jre/lib/i386/ /opt/blackdown-jdk-1.3.1/jre/lib/i386/native_threads/ /usr/qt/3/lib /usr/qt/2/lib /usr/kde/3/lib
It is a good thing to know that
/etc/env.d settings ---> env-update ---> /etc/profile.env ---> /etc/profile ---> bash ---> all your programs
Now that you have a profile.env it should look something like this:
export CONFIG_PROTECT='/usr/kde/3/share/config /usr/share/config' export KDEDIRS='/usr/kde/3:/usr' export MANPATH='/usr/share/man:/usr/local/share/man:/usr/X11R6/man:/opt/blackdown-jdk-1.3.1/man' export INFODIR='/usr/share/info:/usr/X11R6/info' export PATH='/usr/local/bin:/opt/bin:/opt/rar/bin:/usr/X11R6/bin:/opt/blackdown-jdk-1.3.1/bin:/opt/blackdown-jdk-1.3.1/jre/bin:/usr/qt/3/bin:/usr/qt/2/bin:/usr/kde/3/bin' export CONFIG_PROTECT_MASK='/etc/gconf' export CLASSPATH='/opt/blackdown-jdk-1.3.1/jre/lib/rt.jar:.' export ROOTPATH='/usr/local/bin:/opt/bin:/opt/rar:/usr/X11R6/bin:/opt/blackdown-jdk-1.3.1/bin:/opt/blackdown-jdk-1.3.1/jre/bin:/usr/qt/3/bin:/usr/qt/2/bin:/usr/kde/3/bin' export KDEDIR='/usr/kde/3' export VIMRUNTIME='/usr/share/vim/vim61' export JDK_HOME='/opt/blackdown-jdk-1.3.1' export JAVAC='/opt/blackdown-jdk-1.3.1/bin/javac' export PAGER='/usr/bin/less' export HOSTNAME='l00ser.muc.edu' export QMAKESPEC='linux-g++' export LESSOPEN='|lesspipe.sh %s' export CVS_RSH='ssh' export EDITOR='/usr/bin/vim' export QTDIR='/usr/qt/3' export JAVA_HOME='/opt/blackdown-jdk-1.3.1' export XINITRC='/etc/X11/xinit/xinitrc' export MOZILLA_FIVE_HOME='/usr/lib/mozilla'
Alright, thats all I have to say, so go have some fun, and don't break too much!