Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Gentoo This forum is for the discussion of Gentoo Linux.


  Search this Thread
Old 08-10-2012, 11:39 AM   #1
Registered: Nov 2009
Posts: 141

Rep: Reputation: 23
How do I set the correct path in Gentoo Prefix?

/etc/profile and /etc/bash/bashrc do not seem to work. When I enter the prefix (I am on Mac OS X, and my $EPREFIX is /opt/Gentoo), echo $PATH gives:


Notice that the first two are doubled. But what I want is

export PATH=/opt/Gentoo/usr/bin:/opt/Gentoo/bin:/opt/Gentoo/opt/bin:/opt/Gentoo/usr/sbin:/opt/Gentoo/sbin:/opt/Gentoo/usr/x86_64-apple-darwin10/gcc-bin/4.2.1:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/X11R6/bin:/sw/bin:/sw/sbin

So where do I put this command to make it stick? As I said, putting it into /opt/Gentoo/etc/profile or /opt/Gentoo/etc/bash/bashrc (or both) does not work. Creating a file /opt/Gentoo/etc/bashrc (a copy of /opt/Gentoo/etc/bash/bashrc) or putting the export command in the startprefix script does not work either.

Edit: The problem is that /opt/Gentoo/etc/profile is not sourced, which seems like a bug to me. If I enter

. /opt/Gentoo/etc/profile
in the Prefix shell, then echo $PATH gives the correct setting.
But how do I modify the environment if I cannot use /etc/profile?

Last edited by nokangaroo; 08-10-2012 at 12:58 PM.
Old 08-10-2012, 01:23 PM   #2
Registered: Nov 2009
Posts: 141

Original Poster
Rep: Reputation: 23
Solved - created user folder in $EPREFIX

mkdir -p /opt/Gentoo/home/$USER
touch /opt/Gentoo/home/$USER/.bashrc
echo ". /opt/Gentoo/etc/profile" >> /opt/Gentoo/home/$USER/.bashrc
I added the following to /opt/Gentoo/etc/bash/bashrc:

unset PATH
export PATH=/opt/Gentoo/usr/bin:/opt/Gentoo/bin:/opt/Gentoo/opt/bin:/opt/Gentoo/usr/sbin:/opt/Gentoo/sbin:/opt/Gentoo/usr/x86_64-apple-darwin10/gcc-bin/4.2.1:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/X11R6/bin:/sw/bin:/sw/sbin
The funny thing is that my prefix home folder is in /home, but the prompt in the prefix shell reads /Users. It seems to work, but I expect more funkiness. Gentoo prefix is weird, dude.

Edit: I forgot to mention that I also edited the startprefix script; the env -i line now reads

Edit: If I want to start the prefix shell in my home folder I can append

cd ~
to my ${EPREFIX}/etc/bash/bashrc, but this is still weird because it shouldn't be necessary.

Last edited by nokangaroo; 08-10-2012 at 02:38 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gentoo Prefix Bootstrap process Alexvader Solaris / OpenSolaris 2 10-21-2011 05:18 AM
[SOLVED] changing starting or prefix path for Xfce Skaperen Linux - Desktop 4 08-23-2011 12:31 PM
removing path prefix from filesnames AndrewJS Linux - General 7 06-10-2011 11:18 AM
Building .deb with customized prefix path SamTim74 Debian 0 01-22-2008 08:08 PM
Default prefix path when installing from source jrdioko Linux - Newbie 5 01-05-2006 10:40 PM

All times are GMT -5. The time now is 11:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration