getnonfreefonts on a recent TL and Ubuntu

Reinhard Kotucha reinhard.kotucha at web.de
Fri Sep 3 23:06:16 CEST 2021


On 2021-09-03 at 19:46:15 +0000, Hefferon, Jim S. wrote:

 > Hello,
 >
 > I am trying to install Luximono to a brand new Ubuntu and TeX Live
 > installation (Ubuntu 20, TL 2021).  I am having trouble installing
 > getnonfreefonts.  No doubt I am missing some point, but I just
 > cannot see what.  (I am having some trouble with an email account,
 > so I apologize if this message is a dupe.)
 >
 > As described on https://tug.org/fonts/getnonfreefonts/, I used wget
 > to download install-getnonfreefonts to the current directory.  I
 > then tried to run texlua.
 >
 >   ftpmaint at Alonzo:~/Documents$ texlua ./install-getnonfreefonts
 >   Detected System: x86_64-linux Detected Installation:
 >   /usr/local/texlive/2021 mkdir
 >   /usr/local/texlive/2021/texmf-dist/scripts/getnonfreefonts ...
 >   [failed] Sorry, couldn't create directory
 >   /usr/local/texlive/2021/texmf-dist/scripts/getnonfreefonts
 >
 > (I made install-getnonfreefonts executable but that didn't change
 > the outcome.)  OK, maybe sudo?

Hi Jim,
yes, if /usr/local/texlive is owned by root...

 >   ftpmaint at Alonzo:~/Documents$ sudo texlua ./install-getnonfreefonts
 >   sudo: texlua: command not found
 >
 > Maybe it does not like the path?

AFAIK sudo does't use the PATH variable from the environment for
security reasons.

 >   ftpmaint at Alonzo:~/Documents$ sudo /usr/local/texlive/2021/bin/x86_64-  linux/texlua install-getnonfreefonts
 >   lstat(./texlua) failed: ./texlua: No such file or directory
 >   kpathsea: Can't get directory of program name: ./texlua
 >
 > Even this did not work.

I don't understand why your system calls ./texlua (in your current
working directory) though you specified the full path.  I don't know
why this happens.  This should never happen because it's a big
security hole.


 >   ftpmaint at Alonzo:~/Documents$ sudo /usr/local/texlive/2021/bin/x86_64-  linux/texlua /home/ftpmaint/Documents/install-getnonfreefonts
 >   lstat(./texlua) failed: ./texlua: No such file or directory
 >   kpathsea: Can't get directory of program name: ./texlua
 >
 > I note the kpathsea errors.  If it helps, my /etc/profile says this.
 >
 >   export PATH="/usr/local/texlive/2021/bin/x86_64-linux:$PATH"
 >   export MANPATH="/usr/local/texlive/2021/texmf-dist/doc/man:$MANPATH"
 >   export INFOPATH="/usr/local/texlive/2021/texmf-dist/doc/info:$INFOPATH"
 >
 > Using sudo -s or sudo su gave similar results (and are at or past
 > the limits of my knowledge).  Googling around gave results from at
 > most 2016, and they didn't help.  Any ideas would be most welcome.

If sudo su doesn't work there seems to be something severely wrong
with your system.  It's the first thing I do after a Linux
installation in order to set the passwd for root so that I can log in
as root with su and without sudo.

The best you can do is to steal /usr/local and avoid sudo in the
future.  You still need it for Debian updates though.

/usr/local is for local additions and there is no need to be owned by
root.  The sole reason it's owned by root by default is that the Linux
installer is not aware of any users and, of course, only root can
decide whom to grant write access to particular directories.

So my recommendation is to steal the local tree:

   sudo chown -R jim:users /usr/local  (if jim is your login name)

If this works you can change files in /usr/local without sudo.  You
don't need and shouldn't use sudo for "tlmgr update" anymore.  And you
can install getnonfreefonts as a mortable user with TeX Live in PATH.
It's even more secure because a mortal user can't break the system.

But I'm concerned because you said that "sudo su" doesn't work for
you.  I hope that at least "sudo chown ..." works.  If not, your
system is broken and we have to examine the files in /etc.

Regards,
  Reinhard

--
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the texhax mailing list.