You are not logged in.
After a manual installation of texlive 2015 following the Texlive guide, and of course setting the PATH environment variable via /etc/profile.d/texlive.sh to include /usr/local/texlive/2015/bin/x86_64-linux/ and install the texlive-dummy package in the AUR, a very strange thing happened: I can use texlive normally via a terminal, but it seems that in gnome, the gui editors does not search this path. In emacs, when I check the exec-path, it shows only
("/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/usr/lib/emacs/24.5/x86_64-unknown-linux-gnu")
. And of course, editors like texmaker or texstudio also could not find the texlive installation. I figure perhaps gnome has some special way of customizing its environment variables for gui applications, but after browsing the wiki, I couldn't figure out how. I tried .xprofile, .pam_environment etc. Nothing works. So any ideas ?
Offline
It's not strange at all if you use a display manager. Setting the path in /etc/profile.d only applies to login shell sessions and processes that are children of login shell sessions. If you start X via xinit/startx from a tty, it would work. But if you use a DM you'll need to source the profile in one of the DM/DE startup files that other processes inherit from.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
If you start X via xinit/startx from a tty, it would work.
Yes, as you said, if I use startx, everything works.
But if you use a DM you'll need to source the profile in one of the DM/DE startup files that other processes inherit from.
Could you specify how I can do this, please ? Because after I added
source /etc/profile
in .xprofile and use gdm, still I can't use the gui editors to compile latex. Plus, according to the output of
grep profile /etc/gdm/Xsession
, which is
# This is why we source the profile files below.
# First read /etc/profile and .profile
test -f /etc/profile && . /etc/profile
test -f "$HOME/.profile" && . "$HOME/.profile"
# Second read /etc/xprofile and .xprofile for X specific setup
test -f /etc/xprofile && . /etc/xprofile
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
shouldn't gdm source /etc/profile by default ?
So I guess the problem is in gdm then, or I made some stupid mistake ?
Offline
I have no idea how gdm works. Does it use ~/.xprofile? I don't see a mention of that file on the gdm wiki page. What is in ~/.xprofile? Did you add that line before gnome (or whatever) is launched?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I thought gdm should load /etc/gdm/Xsession according to https://help.gnome.org/admin/gdm/stable … on.html.en, and as a consequence, it seems it should source /etc/profile already. And yes, I added that line before gdm is launched, and still no luck. I really don't understand what's wrong here.
Offline
What do you mean you added the line before gdm? Gdm definitely shouldn't be started from ~/.xprofile. Post the actual contents of that file.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Sorry I wasn't clear. I meant I created ~/.xprofile with the following contents:
$ cat ~/.xprofile
source /etc/profile
export PATH="/usr/local/texlive/2015/bin/x86_64-linux/:${PATH}"
and then I reboot the system.
EDIT 1:
I tried also using only one of the two lines, always failed to find tex path in texmaker or emacs by logging in via gdm.
EDIT 2:
I am sure ~/.xprofile and ~/.pam_environment are indeed loaded since I can successfully set other variables there. So I am thinking maybe gdm reset the PATH variable after loading ~/.xprofile, ~/.pam_environment etc.
Last edited by brevity (2016-05-01 02:13:08)
Offline
I found that even without any .xprofile, .pam_environment etc., I can use texlive if I first start the editor(e.g., texmaker) and then use the editor to open the .tex file, but if I open the file directly by double click on it, the texlive path is lost again !
Offline
OK, now I think the problem is nautilus. I tried installing dolphin in gnome and from dolphin double click to open tex files, everything works just fine. It seems I have a problem only when using nautilus in gnome, strange...
EDIT
Yeah, it is nautilus which resets the PATH ! I launch a terminal by right click in nautilus and choose the open in terminal tab. A terminal opens, and
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Don't know how to fix this.
Last edited by brevity (2016-05-01 15:55:20)
Offline
Obviously, it's a nautilus bug since gnome 3.16, and yet to be fixed.
Offline