GnuTLS Error -50: Cannot install packages from Github in Rstudio?

144 views Asked by At

The following lines prompt an error (which differs from this question):

library(devtools)
install_github("StatsWithR/statsr") # the same for any other open repos

The error is this:

Error: Failed to install 'unknown package' from GitHub:
Error -50 setting GnuTLS cipher list starting with +VERS-TLS1.3

Then I wanted to work around the problem caused by devtools, so I tried githubinstall, but the error became this:

Error in curl::curl_download(input, tmpFile, mode = "wb", quiet = !showProgress) :
Error -50 setting GnuTLS cipher list starting with +VERS-TLS1.3

It seems obvious that the issue is caused by GnuTLS and I found a similar thread: git/jenkins TLS issue, but I cannot find some hints there.

I also tried install_url, install_local, and install_git, but all failed.

Here is the information of the R I recently upgraded from 3.4.4(2018):

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          1.2                         
year           2021                        
month          11                          
day            01                          
svn rev        81115                       
language       R                           
version.string R version 4.1.2 (2021-11-01)
nickname       Bird Hippie

I have been stuck with devtools and install_github. What can I try next?

1

There are 1 answers

2
Lerner Zhang On

I installed the r-base and Rstudio using apt install in an existing container, and the default settings(the default r version is 3.4.4) caused the issues I met, then I purged the r environment and created a new one in a new Docker container following this blog: Running RStudio Server with Docker.