You are not logged in.
I am new to Arch, and I tried to install TeX Live. I read the article https://wiki.archlinux.org/title/TeX_Live. I chose to go with the native installer since I prefer to have daily updates to packages. After the installer finished, I added the paths it gave me to the `MANPATH`, `INFOPATH` and `PATH` variables and restarted the shell. According to the wiki page, running `tlmgr update --all` should upgrade all the packages I have. I tried to run that command, but it complained that I don't have permissions:
tlmgr: package repository https://ctan.mc1.root.project-creative.net/systems/texlive/tlnet (verified)
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2025/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.
So I tried to run it as sudo: `sudo tlmgr update --all`, but then it couldn't find the `tlmgr` command at all:
sudo: tlmgr: command not found
Clearly, the paths are set correctly since `tlmgr` worked without sudo, and other commands such as `latex`, `lualatex`, etc also work. However, trying to run `tlmgr` as sudo caused it not to recognize the command. How is it even possible that the command works normally, but doesn't work with sudo, and how can I fix this?
Offline
Post the outputs of
$ echo $PATH
$ type -a tlmgr
$ sudo echo $PATH
$ sudo type -a tlmgr
$ ls -al /usr/local/texlive/2025/tlpkg/
Moderator Note
texlive native install is not using pacman or archlinux repos, moving to GNU/Linux Discussion
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
The behavior you're experiencing is most likely related to the following option being enabled in your /etc/sudoers:
## Use a hard-coded PATH instead of the user's to find commands.
## This also helps prevent poorly written scripts from running
## arbitrary commands under sudo.
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/bin"
You may want to add your TeX Live installation directory to this list, or you could simply run the command this way:
sudo $(which tlmgr)
Offline
sudo $(which tlmgr)
Aah, that's an interesting one. Never thought about it this way.
Offline
Adding the TeX installation directory to the secure_path indeed solved this. Thank you.
Is there a recommended approach to secure_path? Should I just add my custom paths to it, or is there a more secure or preferred approach?
Offline