Talk:Environment variables

From ArchWiki
(Redirected from Talk:Environment Variables)
Jump to: navigation, search

I created this page due to the lack of info I could find on Environment Variables in the Arch wiki, except a few sentences in the Bash page. Hopefully this page may prompt some more knowledgeable people on the subject to review and edit as required to more accurately reflect an Arch Linux system. See


I'm not sure if you want to include such details here, but the visudo manpage has an explanation why your EDITOR isn't the one used to edit when using visudo:

There is a hard-coded list of one or more editors that visudo will use set at compile-time that may be
overridden via the editor sudoers Default variable.  This list defaults to "/usr/bin/vi".  Normally, visudo
does not honor the VISUAL or EDITOR environment variables unless they contain an editor in the aforementioned
editors list.  However, if visudo is configured with the --with-env-editor option or the env_editor Default
variable is set in sudoers, visudo will use any the editor defines by VISUAL or EDITOR.  Note that this can
be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or

-- Karol 18:58, 30 May 2011 (EDT)

Thanks for the info Karol. I have my editor for manipulating the sudoers file set to Nano. To be honest, I don't really remember the details other than setting EDITOR to nano somewhere..... Would you please add the above info as you see appropriate, into the EV page? Also jump in and help out where ever else you'd like - jeff story
Our package is built with '--with-env-editor' so just setting your EDITOR is enough. You can add this info to your article if you want. -- Karol 15:10, 19 August 2011 (EDT)


The article mentions putting your environment variables in /etc/profile. /etc/profile seems to source from the files in /etc/profile.d which seems like a less disruptive place to put your new variables, similar to the way modules-load.d works these days TheCycoONE (talk) 12:56, 15 September 2012 (UTC)

Certainly a bit late, but I totally agree with the need to mention /etc/profile.d/ for globally defined environment variables, as well as /etc/pam.d/ and /etc/security/pam_env.conf.
Quite a few packages place their files there (have a go at $ pacman -Qo /etc/profile.d/*, two packages from [base] (filesystem and perl) place files there, without mentioning other common desktop packages such as mozilla-common and libreoffice-common), and it appears it can also help environment variables to take effect in graphical applications (see my note in VDPAU#Configuration).
I checked the Talk page as I was about to add that info, because it seems surprisingly difficult to have a definitive answer on "where to put environment variable for graphical applications to inherit them" (while not using xinitrc, as per Environment_variables#Graphical_applications).
If no comments or objections are made within one week, I'll try to make some edits on this.
-- Neitsab (talk) 18:09, 15 May 2014 (UTC)
+1 for mentioning /etc/profile.d/. You're the first to reply to TheCycoONE in almost 2 years, I don't think you need to wait an additional week for editing the article :) -- Kynikos (talk) 14:07, 16 May 2014 (UTC)

Add more information about the obscure ~/.pam_environment

Well, that's it. I added a section Environment variables#Using ~/.pam_environment to better explain how to use the file. Feedback is welcome! :)

- Pabloxcl (talk) 18:01, 20 February 2016 (UTC)

I've moved the section under Environment variables#Examples, because it applies to /etc/environment just as well. -- Lahwaacz (talk) 16:25, 6 March 2016 (UTC)
Fair enough! (though, I haven't tried it on /etc/environment)--Pabloxcl (talk) 03:30, 8 March 2016 (UTC)
Close. --Fengchao (talk) 09:25, 20 April 2016 (UTC)