Search code examples
rlinuxubuntu-18.04rstudio-serverinstall.packages

How to install R packages in RStudio Server


I converted an old laptop of mine into a Ubuntu Server (18.04) which I would like to use for file sharing and running RStudio Server.

I successfully download RStudio Server and can open it on my new laptop through Chrome.

I would like to download tidyverse (or just dplyr and stringr) to run a few commands, but when I do install.packages("dplyr") I get the following message:

Installing package into ‘/home/jacobdavis95/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/dplyr_0.8.3.tar.gz'
Content type 'application/x-gzip' length 1173098 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘dplyr’ ...
** package ‘dplyr’ successfully unpacked and MD5 sums checked
** libs

Followed by this line, repeated many times

g++  -I/usr/share/R/include -DNDEBUG -I../inst/include -DRCPP_DEFAULT_INCLUDE_CALL=false -DCOMPILING_DPLYR -DRCPP_USING_UTF8_ERROR_STRING -DRCPP_USE_UNWIND_PROTECT -DBOOST_NO_AUTO_PTR  -I"/home/jacobdavis95/R/x86_64-pc-linux-gnu-library/3.4/BH/include" -I"/home/jacobdavis95/R/x86_64-pc-linux-gnu-library/3.4/plogr/include" -I"/home/jacobdavis95/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o

and finally

/tmp/cc3w1guR.s: Assembler messages:
/tmp/cc3w1guR.s: Fatal error: can't write 3924 bytes to section .debug_loc of mutate.o: 'No space left on device'
/tmp/cc3w1guR.s: Fatal error: can't close mutate.o: No space left on device
/usr/lib/R/etc/Makeconf:168: recipe for target 'mutate.o' failed
make: *** [mutate.o] Error 1
ERROR: compilation failed for package ‘dplyr’
* removing ‘/home/jacobdavis95/R/x86_64-pc-linux-gnu-library/3.4/dplyr’
Warning in install.packages :
  installation of package ‘dplyr’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmplNsTeo/downloaded_packages’

I don't understand what some of these messages mean. One of the lines also says, "no space left on device" which doesn't make sense because it's a 500 GB SDD that is nearly empty.

Most forums/websites I've looked at aren't involving Ubuntu Server, just Ubuntu Desktop. I did try following the advice on https://www.r-bloggers.com/installing-rstudio-server-on-ubuntu-server/ but ended up running into the same issues.

Has anyone had this issue before? How do I go about fixing this?


Solution

  • For whatever reason, there was an issue with the initial installation of Ubuntu Server, and the system was only registering that I had 4 GB on the drive. As a result, I reinstalled Ubuntu Server and it corrected itself, and now there is enough space to install packages.