TeX Live and MacTeXPATH Problem

Information and discussion about TeX Live distribution for all platforms (Windows, Linux, Mac OS X) and the related MacTeX: installing, updating, configuring
Post Reply
sbishop33
Posts: 2
Joined: Thu Aug 31, 2017 4:39 am

PATH Problem

Post by sbishop33 »

Hi All,
I am running Ubuntu 16.04. Almost immediately after installing it, I installed TexLive 2017 from the TexLive web site. Later, I installed Lilypond and Frescobaldi, one of which I think installed an older version of TexLive or at least some core components of that version. TexLive 2017 works fine using an editor configured to point to the 2017 executables. The problem is that when I run tlmgr from the command line I get two different versions of the program, depending on whether I use sudo or not. Sudo tlmgr --gui starts the older version, running from /usr/share/texlive; tlmgr --gui starts the 2017 version, running from /usr/local/texlive/2017, but of course, not using sudo means that the texlive root and subfolders are not writable, which means I cannot update any packages. I think I can solve this with chmod, but I'm curious why using sudo points to a different version of texlive? I have line in my .bashrc file that adds the texlive 2017 path the the $PATH variable. /usr/share/texlive is not in the PATH statment.

Thanks for any light that anyone can shed on this problem.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

PATH Problem

Post by rais »

well, I'd compare the outcome of

Code: Select all

echo $PATH
with

Code: Select all

sudo echo $PATH
KR
Rainer
sbishop33
Posts: 2
Joined: Thu Aug 31, 2017 4:39 am

PATH Problem

Post by sbishop33 »

Thanks for replying. I did try both those commands with the same results: the path statement is as set in the .bashrc file--i.e., the one I want to be there.

In the interim, I have made the /usr/local/texlive/2017 folder and subfolders writable with the chmod command. Now, tlmgr --gui at the command line starts the 2017 version of tlmgr and it is capable of doing the package updates as usual.

I'm still curious why sudo tlmgr --gui starts an older version of the application if the $PATH variable contains the correct path to the 2017 version folders.

Thanks again,

SB
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

PATH Problem

Post by rais »

The way I see it, you've got two options. Assuming sudo switches to user root: either sudo switches by default the environment to root's environment (in which case, `echo' is somehow exempt from that rule), or sudo keeps the current user's environment (in which case, `tlmgr' is somehow exempt from that rule).
If you want to pursue this issue further, try

Code: Select all

man sudo
and have a look at /etc/sudo*...

KR
Rainer
Post Reply