Install TinyTeX: certificate has expired


I am trying to install TinyTeX in R (v 3.6.3) but am getting a persistent error about expired certificates (see below). A similar error is raised here: tinytex certificate is out of date?, the solution being changing the repository argument in install_tinytex(). I've tried this ( e.g., tinytex::install_tinytex(repository = '')) with no luck - I still get the same error.

Any ideas on how to try and fix this would be so greatly appreciated!

trying URL ''
trying URL ''
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL certificate problem: certificate has expired
More details here:

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.
Error in download.file(url, output, ..., method = method) : 
  'curl' call had nonzero exit status
In addition: Warning messages:
1: In download.file(url, output, ..., method = method) :
  URL '': status was 'Peer certificate cannot be authenticated with given CA certificates'
2: In download.file(url, output, ..., method = method) :
  URL '': status was 'Peer certificate cannot be authenticated with given CA certificates'

Thanks for the report. We'll look into this to see if there is something on our server missing.

Can you try this in the meantime ?

tinytex::install_tinytex(version = "2021.10")

This would install the last bundled version (from instead of the latest daily build.

Thanks Christophe!

No problems running that code:

trying URL ''
Content type 'application/octet-stream' length 87001909 bytes (83.0 MB)
downloaded 83.0 MB

But then (after restarting R studio) knitting a pdf document fails:

/usr/local/bin/tlmgr: TLPDB::from_file could not initialize from:
/usr/local/bin/tlmgr: Maybe the repository setting should be changed.
/usr/local/bin/tlmgr: More info:
! LaTeX Error: File `lineno.sty' not found.

! Emergency stop.
<read *>

Not sure if this is the same issue - or a seperate one caused by me frantically trying to fix the first one...



I have the same problem. Suddenly I can not knit to pdfs, although it worked perfectly. I test run it on files which compiled before. I am getting the following error message:

I then tried reinstalling TinyTeX by running

tinytex::install_tinytex() # install TinyTeX

and get the same error as Mres.

Any ideas what is happening?

Thank you!

Best, M.

This is the error that I get after running

tinytex::install_tinytex() # install TinyTeX


I think this is an issue with the online CTAN mirror. It could resolve by itself. Please retry.

Otherwise, you can try use another CTAN mirror to install LaTeX package from

Certainly looks that way.
I've got it working by specifying both a version and repository in the install_tinytex function:

tinytex::install_tinytex(repository = "", version = "latest")

Thanks so much for your help!

1 Like

Thanks!!!! This worked for me as well!!!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.