Unable to install binary packages from packagemanager.rstudio.com on Linux

I'm unable to get R to install binary packages from packagemanager.rstudio.com on a CentOS Linux server. R will always fetch the source and compile it instead of getting the binary when I try to install a package.

I'm not sure what I'm doing wrong. My company's security policy doesn't allow compilers on production servers, so I was hoping to get binary packages to install so I won't have to build and package them elsewhere.

I see someone else is having the same issue at Should I be able to install binary packages on fedora.

I'm testing on CentOS 7.8 with R 3.6.3. I installed R from source using the directions at https://docs.rstudio.com/resources/install-r-source/. Then I set up R to use binary packages as described at https://packagemanager.rstudio.com/client/#/repos/1/overview.

Contents of my .Rprofile:

options(repos = c(REPO_NAME = "https://packagemanager.rstudio.com/all/__linux__/centos7/latest"))

If I run a command such as install.packages("stringi"), it will download the source.

Here's some example output:

> install.packages("stringi")
trying URL 'https://packagemanager.rstudio.com/all/__linux__/centos7/latest/src/contrib/stringi_1.5.3.tar.gz'
Content type 'binary/octet-stream' length 7297484 bytes (7.0 MB)
downloaded 7.0 MB

* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** using staged installation
checking for R_HOME... /opt/R/3.6.3/lib64/R
checking for R... /opt/R/3.6.3/lib64/R/bin/R
checking for endianness... little
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for local ICUDT_DIR... icu61/data
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes

I also appended the following two lines to my .Rprofile, but it didn't make a difference.

options(install.packages.check.source = "no")
options(install.packages.compile.from.source = "never")

I've only been using R for a few days, so feel free to explain like I'm five, or direct me to the docs if I've missed something simple.

One typical problem is the user agent header, which you can test with


If this does not report success, you should follow the printed instructions to update your configuration. See https://docs.rstudio.com/rspm/admin/serving-binaries/#binary-user-agents for more details.

BTW, you can make your live easier by using our pre-compiled binaries.

1 Like

Thanks. That script told me to add options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os))) to my .Rprofile, and that fixed the problem.

1 Like

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.