After installing hosted RStudio on Linux Centos, cannot install any packages "Non zero exit status"



I was able to install RStudio on a Centos7 Linux server so as I can access hosted RStudio in my browser.

I downloaded and installed rstudio in my terminal as root user doug. When visited my hosted rstudio instance and attempted to login with login details for doug I was unable to so I created a new user using adduser called 'rstudio'.

After setting new user rstudio a password I was able to login.

At this point I can use R within R studio and everything looks fine. I'm able to run base R, save scripts etc from within RStudio GUI.

However, I'm unable to install.packages(). Any and all packages I attempt to install come back with error message

Warning in install.packages :
  installation of package ‘[any package I try to install name]’ had non-zero exit status

I tried installing packages within R within the terminal. First as newly created user 'rstudio' and then as myself 'doug'. In both cases I received the same error message when trying to install packages.

I suspected a user permissions issue and granted rstudio read, write and execute permissions on /home/rstudio.

I also tried adding parameter dependencies = T on my install.packages() commands however I still received the same message and failed to install any packages.

Whats causing this and how can I overcome this?

R version 3.5.0 (2018-04-23)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0    yaml_2.2.0  


Hey @dougfir! Welcome to RStudio Community :smiley:

Thanks for the info on your problem! I think we might need to back up a bit from the error you're getting when you try to install packages to see if we can pinpoint the problem. Are you able to try to install a couple and give us the complete output from the console? That way we can try to figure out what's happening (or, indeed, whether there aren't several interacting problems).


I guess you only installed r-core, you still need install r-devel


Hi Peter, yes, that was it. I missed the console message that said I needed to install that package via terminal. Problem solved, thanks


Hi Rensa, I was missing a package on CentOs, I missed the R error message conveniently advising me which package was missing. After installing r-devel I was able to install packages.