I get this error either using either tinytex::install_tinytex() or the os x install script
macOS 10.13.3
add_link_dir_dir: destination /usr/local/bin not writable, no links from /Users/hagen/Library/TinyTeX/bin/x86_64-darwin.
add of symlinks had 1 error(s), see messages above.
add of symlinks had 1 error(s), see messages above.
tlmgr: An error has occurred. See above messages. Exiting.
That is odd. /usr/local/bin should be writable by default on (at least recent versions of) macOS. Anyway, see https://stackoverflow.com/a/26647594/559676 for how to regain the write permission. In short, run this in your terminal:
sudo chown -R `whoami`:admin /usr/local/bin
Then this in your terminal (do not use sudo here!):
~/Library/TinyTeX/bin/*/tlmgr path add
That worked. Thanks!
+1 just hit this issue on a completely fresh Mac running High Sierra. The informative error message was a life saver. Thanks for the user focused development!
FYI Of 50+ students using macOS 6 have (sofar) reported this error. I'm providing the hack below to check if /usr/local/bin is writeable and move on with the install process. Is there an easier/cleaner way to do this perhaps?
if (file.access("/usr/local/bin", mode = 2) == -1) {
tf <- tempfile()
cat("#!/bin/bash\nsudo chown -R `whoami`:admin /usr/local/bin\nRscript -e 'tinytex::install_tinytex()'\n", file = tf)
Sys.chmod(tf, mode = "0755")
system(paste0('osascript -e \'tell application "Terminal" to activate\' -e \'tell application "Terminal" to do script "', tf, '"\''))
} else {
tinytex::install_tinytex()
}
I can make TinyTeX work without requiring /usr/local/bin to be writable. The only problem is that TinyTeX will only work with tinytex. Writing symlinks to /usr/local/bin will make sure that LaTeX can be found on PATH, hence accessible to other programs in the system.
"accessible to other programs in the system" is certainly important. Thanks for the great tool @yihui
@vnijs I started working on a new Macbook this week and had this problem myself, so I just applied the trick osascript in install_tinytex() to ask for password to change the owner of /usr/local/bin: 85b626c. Hopefully this will no longer be a problem for macOS users.
Just tried to install using
install.packages('tinytex') and tinytex::install_tinytex() in R on MacOS (Mojave) and am having the same issue. But I am VERY very new to this, so could be user error? I have no idea what I'm doing.
@zoelzilz First, please make sure you have installed the latest version of tinytex (>= 0.9). Then when you see a dialog like this, input your password if you trust me:

otherwise follow what the error message tells you to do.
Just as an FYI ... I just worked with a student that was asked for her password to make /usr/local/bin writable and the install still wasn't successful in the end. Weird. See screenshot below. That said, I just installed on a new mac of my own and it worked fine. Go figure.

@vnijs Does file.access('/usr/local/bin', 2) return 0?
Can she also try the method I mentioned in my first reply above?
Same problem here. file.access('/usr/local/bin', 2) returns -1.
@jenzopr Even after you did what I said above in the first reply? https://github.com/yihui/tinytex/issues/24#issuecomment-372043672
I was encountering the same errors as vnijs on HighSierra OS. What finally seemed to work was using the suggesting in comment #2 and then running tinytex::install_tinytex(force = TRUE)
This is still an issue. The prompt is not showing up on mac OS to prompt for the users password. Also the documention does not mention the force=TRUE option. Could you add that to: https://yihui.name/tinytex/?
Please try the current development version of tinytex. It no longer requires /usr/local/bin to be writable. Things should work out of the box if you are compiling R Markdown to PDF or calling tinytex::latexmk() to compile LaTeX documents.
Thanks @yihui. I used tinytex::uninstall_tinytex() and then tinytex::install_tinytex() and it seems the TinyTex is now installed into /Users/username/Library/TinyTex. That seems like a great idea and everything seems to work fine so far. That said, I'm a bit confused by the latest commit (https://github.com/yihui/tinytex/commit/4e902ba0e635862d7d7bf12714af7d3f11cfe2e1) that still refers to /usr/local/bin in install.R and checks if that directory is writable. Can you elaborate perhaps?
@vnijs There was no change in the installation dir (it has always been ~/Library/TinyTeX). The change was that I'd attempt to create symlinks from ~/Library/TinyTeX to /usr/local/bin, and if it fails, I'd give up instead of signaling an error (as I did before). If you compile LaTeX documents through the R package tinytex (which is what the rmarkdown package does), I won't require LaTeX symlinks under /usr/local/bin.
The downside is as I said previously at https://github.com/yihui/tinytex/issues/24#issuecomment-422634621: if those symlinks are not under /usr/local/bin, it means TinyTeX cannot be called directly by other software packages in the system without using the full path. This is not a concern for R Markdown users. Compared to the constant confusion caused by the /usr/local/bin that is not writable, I feel this is an acceptable downside. What's more, if anyone is really bitten by this issue, I have provided the solution in the very first reply in this thread (i.e., https://github.com/yihui/tinytex/issues/24#issuecomment-372043672).
Got it. Thanks @yihui. It seems like everything is working fine. If my students do hit any snags I'll let you know.
FYI Some of my students still seem to be having problems installing tinytex on macOS because /usr/local/bin is not writable (see message below). I'll be able to investigate in more detail when I see the students in a few weeks.
done running updmap-sys.
regenerating fmtutil.cnf in /Users/ross/Library/TinyTeX/texmf-dist
running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine tex ...
done running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine tex.
running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --byfmt mf ...
done running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --byfmt mf.
tlmgr: package log updated: /Users/ross/Library/TinyTeX/texmf-var/web2c/tlmgr.log
add_link_dir_dir: destination /usr/local/bin not writable, no links from /Users/ross/Library/TinyTeX/bin/x86_64-darwin.
add of symlinks had 1 error(s), see messages above.
tlmgr: An error has occurred. See above messages. Exiting.
Error: Failed to install TinyTeX
I just created a new user account on my mac and was able to reproduce the problem (see below for latest version on CRAN 0.15). Tinytex still asks to run a script to change permissions but install fails at the end. Any suggestions?
running mktexlsr ...
done running mktexlsr.
running updmap-sys ...
done running updmap-sys.
regenerating fmtutil.cnf in /Users/rsm-vnijs/Library/TinyTeX/texmf-dist
running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine tex ...
done running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine tex.
running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --byfmt mf ...
done running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --byfmt mf.
tlmgr: package log updated: /Users/rsm-vnijs/Library/TinyTeX/texmf-var/web2c/tlmgr.log
add_link_dir_dir: destination /usr/local/bin not writable, no links from /Users/rsm-vnijs/Library/TinyTeX/bin/x86_64-darwin.
add of symlinks had 1 error(s), see messages above.
tlmgr: An error has occurred. See above messages. Exiting.
@vnijs Should be fixed now. Thanks for the report and reproducing the issue!
Seems to be working now. Thanks @yihui!
A quick update. I'm currently setting up my Mac with an M1 processor and ran into the same issue. Running Yihui's instructions (https://github.com/yihui/tinytex/issues/24#issuecomment-372043672) helped, but the second command should be (for an M1 Mac):
~/Library/TinyTeX/bin/universal-darwin/tlmgr path add
@dragosmg Thank you! I just updated my instruction above to use the wildcard (i.e. ~/Library/TinyTeX/bin/*/tlmgr) so that the system architecture won't matter.
Hello! I am new in R. I need to download files in pdf but I am having this error. Anyone can help me please?
tinytex::install_tinytex(force = TRUE)
tlmgr option repository 'ctan'
tlmgr: setting default package repository to https://mirror.ctan.org/systems/texlive/tlnet
@MariaQuintero I don't see any error. I see a message. If that is what you meant, you can safely ignore the message.
Most helpful comment
That is odd.
/usr/local/binshould be writable by default on (at least recent versions of) macOS. Anyway, see https://stackoverflow.com/a/26647594/559676 for how to regain the write permission. In short, run this in your terminal:Then this in your terminal (do not use
sudohere!):