Can not install any package on Linux

Hello everyone!

After switching to a Linux machine I found out that I can not install any package in RStudio. This simpliest task gives me a huge error.
I would be very thankful for advices on what should I do with it.

> install.packages('AICcmodavg')
Installing package into ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘minqa’, ‘nloptr’, ‘RcppEigen’, ‘sp’, ‘lme4’, ‘plyr’, ‘raster’, ‘Rcpp’, ‘TMB’, ‘RcppArmadillo’, ‘unmarked’, ‘VGAM’, ‘xtable’

trying URL 'https://cloud.r-project.org/src/contrib/minqa_1.2.4.tar.gz'
Content type 'application/x-gzip' length 53548 bytes (52 KB)
==================================================
downloaded 52 KB

trying URL 'https://cloud.r-project.org/src/contrib/nloptr_1.2.2.2.tar.gz'
Content type 'application/x-gzip' length 2450931 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

trying URL 'https://cloud.r-project.org/src/contrib/RcppEigen_0.3.3.9.1.tar.gz'
Content type 'application/x-gzip' length 1633360 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/sp_1.4-5.tar.gz'
Content type 'application/x-gzip' length 1049195 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cloud.r-project.org/src/contrib/lme4_1.1-27.1.tar.gz'
Content type 'application/x-gzip' length 3311365 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

trying URL 'https://cloud.r-project.org/src/contrib/plyr_1.8.6.tar.gz'
Content type 'application/x-gzip' length 401191 bytes (391 KB)
==================================================
downloaded 391 KB

trying URL 'https://cloud.r-project.org/src/contrib/raster_3.4-13.tar.gz'
Content type 'application/x-gzip' length 582026 bytes (568 KB)
==================================================
downloaded 568 KB

trying URL 'https://cloud.r-project.org/src/contrib/Rcpp_1.0.7.tar.gz'
Content type 'application/x-gzip' length 2941808 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

trying URL 'https://cloud.r-project.org/src/contrib/TMB_1.7.21.tar.gz'
Content type 'application/x-gzip' length 615111 bytes (600 KB)
==================================================
downloaded 600 KB

trying URL 'https://cloud.r-project.org/src/contrib/RcppArmadillo_0.10.6.0.0.tar.gz'
Content type 'application/x-gzip' length 1673880 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/unmarked_1.1.1.tar.gz'
Content type 'application/x-gzip' length 2123612 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

trying URL 'https://cloud.r-project.org/src/contrib/VGAM_1.1-5.tar.gz'
Content type 'application/x-gzip' length 1580498 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'https://cloud.r-project.org/src/contrib/xtable_1.8-4.tar.gz'
Content type 'application/x-gzip' length 564589 bytes (551 KB)
==================================================
downloaded 551 KB

trying URL 'https://cloud.r-project.org/src/contrib/AICcmodavg_2.3-1.tar.gz'
Content type 'application/x-gzip' length 678217 bytes (662 KB)
==================================================
downloaded 662 KB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
/usr/lib/R/bin/config: 1: eval: make: not found
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether the C++ compiler works... no
configure: error: in `/tmp/RtmpzmTAcg/R.INSTALL997c322384c8/nloptr':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/nloptr’
Warning in install.packages :
  installation of package ‘nloptr’ had non-zero exit status
* installing *source* package ‘sp’ ...
** package ‘sp’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
sh: 1: make: not found
Warning in system(cmd) : error in running command
ERROR: compilation failed for package ‘sp’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/sp’
Warning in install.packages :
  installation of package ‘sp’ had non-zero exit status
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
sh: 1: make: not found
Warning in system(cmd) : error in running command
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/Rcpp’
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status
* installing *source* package ‘VGAM’ ...
** package ‘VGAM’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
sh: 1: make: not found
Warning in system(cmd) : error in running command
ERROR: compilation failed for package ‘VGAM’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/VGAM’
Warning in install.packages :
  installation of package ‘VGAM’ had non-zero exit status
* installing *source* package ‘xtable’ ...
** package ‘xtable’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (xtable)
ERROR: dependency ‘Rcpp’ is not available for package ‘minqa’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/minqa’
Warning in install.packages :
  installation of package ‘minqa’ had non-zero exit status
ERROR: dependency ‘Rcpp’ is not available for package ‘RcppEigen’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/RcppEigen’
Warning in install.packages :
  installation of package ‘RcppEigen’ had non-zero exit status
ERROR: dependency ‘Rcpp’ is not available for package ‘plyr’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/plyr’
Warning in install.packages :
  installation of package ‘plyr’ had non-zero exit status
ERROR: dependencies ‘sp’, ‘Rcpp’ are not available for package ‘raster’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/raster’
Warning in install.packages :
  installation of package ‘raster’ had non-zero exit status
ERROR: dependency ‘Rcpp’ is not available for package ‘RcppArmadillo’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/RcppArmadillo’
Warning in install.packages :
  installation of package ‘RcppArmadillo’ had non-zero exit status
ERROR: dependencies ‘minqa’, ‘nloptr’, ‘Rcpp’, ‘RcppEigen’ are not available for package ‘lme4’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/lme4’
Warning in install.packages :
  installation of package ‘lme4’ had non-zero exit status
ERROR: dependency ‘RcppEigen’ is not available for package ‘TMB’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/TMB’
Warning in install.packages :
  installation of package ‘TMB’ had non-zero exit status
ERROR: dependencies ‘lme4’, ‘plyr’, ‘raster’, ‘Rcpp’, ‘TMB’, ‘RcppArmadillo’ are not available for package ‘unmarked’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/unmarked’
Warning in install.packages :
  installation of package ‘unmarked’ had non-zero exit status
ERROR: dependencies ‘unmarked’, ‘VGAM’ are not available for package ‘AICcmodavg’
* removing ‘/home/dmytro/R/x86_64-pc-linux-gnu-library/4.1/AICcmodavg’
Warning in install.packages :
  installation of package ‘AICcmodavg’ had non-zero exit status

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

I believe this is an R error vs an RStudio error

Have you investigated the repeated error message /usr/lib/R/bin/config: 1: eval: make: not found ?

I think one option is to tell your system about the R binaries on CRAN. Assuming you're on Ubuntu, check out:

https://cran.r-project.org/bin/linux/ubuntu/
(And other versions of linux)

You have no compilers installed in the system, try installing this system dependencies from a system terminal.

sudo apt install make gcc g++ cmake gfortran r-base-dev
1 Like

It did help me!
Thank you so much