Search code examples
rsslr-markdownblogdown

SSL errors installing hugo in blogdown


I'm trying to install blogdown and hugo on my Linux machine running R 4.0.2. When I do blogdown::install_hugo() I get this error message:

Error in file(con, "r") : 
cannot open the connection to 'https://github.com/gohugoio/hugo/releases/latest'
In addition: Warning message:
In file(con, "r") :
URL 'https://github.com/gohugoio/hugo/releases/latest': status was 'Problem with the SSL CA cert (path? access rights?)'

I started getting this error installing any package, including from CRAN, a couple of months ago. I fixed it with this helpful bit of code in my .Rprofile file:

options(download.file.method = "wget")
local({
         r<- getOption("repos");
         r["CRAN"] <-"https://cran.rstudio.com/"
         options(repos=r)
})

Now I have no problem installing and updating packages from CRAN but I can't install hugo. I tried reinstalling curl and httr but that did not help. It seems this problem first arose a month or so ago when I renewed my client certificate from cacert.org, but I don't know if it's related or not. All I did was install the renewed certificate in my browser so I don't think it has anything to do with this problem.

Any help will be greatly appreciated.


Solution

  • You may download hugo_extended_*_Linux-64bit.tar.gz from https://github.com/gohugoio/hugo/releases/latest with your web browser, and pass the local file path to install_hugo() to install it, e.g.,

    blogdown::install_hugo('~/Downloads/hugo_extended_0.78.2_Linux-64bit.tar.gz')