[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "The following environment variable definitions may be needed"

From: Niall Dooley
Subject: Re: "The following environment variable definitions may be needed"
Date: Wed, 10 May 2017 22:49:44 +0100

This too has confused me so perhaps an update of the manual is in order. Like
others I too followed the instructions in the manual
and have the following
in my .bashrc (my system (a foreign distro - Trisquel 7) doesn't have a
.bash_profile but only a .profile which sources .bashrc):

GUIX_PROFILE=$HOME/.guix-profile \
source $HOME/.guix-profile/etc/profile

(Note I removed the quotes as given in the manually as I believe they are only
necessary if there is whitespace.)

The problem is this duplicates an entry in my PATH, as follows:


Removing the definition of GUIX_PROFILE from my .bashrc and only keeping the
`source' line does not resolve this duplication. It merely replaces
$HOME/.guix-profile in the path with the /gnu/store pathname if that makes

Now, the contents of $HOME/.guix_profile/etc/profile is as follows:

# Source this file to define all the relevant environment variables in Bash
# for this profile.  You may want to define the 'GUIX_PROFILE' environment
# variable to point to the "visible" name of the profile, like this:
#  GUIX_PROFILE=/path/to/profile \
#  source /path/to/profile/etc/profile
# When GUIX_PROFILE is undefined, the various environment variables refer
# to this specific profile generation.


I suspect this duplication comes from the definition here of the PATH. Is
that correct?

To me at least the instructions in the manual and the advise from both ng0
and Ludo in this thread conflict? Or am I misunderstanding something obvious.

Thanks in advance.

On 10 May 2017 at 14:39, myglc2 <address@hidden> wrote:
> On 05/10/2017 at 14:01 Ludovic Courtès writes:
>> Hi!
>> Chris Marusich <address@hidden> skribis:
>>> This leads to my question: If I'm using GuixSD (or a foreign distro in
>>> which $GUIX_PROFILE/etc/profile is automatically sourced), do I need to
>>> add these recommended export statements to my ~/.bashrc or
>>> ~/.bash_profile?
>> No.
>>> My suspicion is that the answer is "no".  The next time I reboot or log
>>> out and back in, the environment variables will be set correctly even if
>>> I don't add them to my ~/.bashrc or ~/.bash_profile.  In fact, by adding
>>> them there, I would be adding redundant entries.  I am hoping that
>>> someone can confirm that my understanding is correct.
>> Confirmed!
>> I think the recommendations that ‘guix package’ produces are still
>> useful though, precisely because $GUIX_PROFILE/etc/profile won’t be
>> re-sourced until you log in again.
> These messages were a source of confusion for me.  It is really great to
> see this clarified.
> What if we change the message from ...
> The following environment variable definitions may be needed:
>    export PATH="test-profile/bin${PATH:+:}$PATH"
> ... to ...
> If you need the package before the next login, do:
>    export PATH="test-profile/bin${PATH:+:}$PATH"
>> Exercise for the reader: extend Bash with Guile-Bash such that the new
>> environment variable settings are automatically effected when ‘guix
>> package’ is run.  :-)
> This sounds cool. Could you please expand on it a bit?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]