Install lme4 from CRAN on Ubuntu

Viewed 5308

I'm having trouble installing the lme4 package from CRAN on Ubuntu 18.04. I'm running install.packages("lme4") on R 3.4.4 and get the following error:

ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/3.4/nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/3.4/lme4’

Looking more closely, I see these two error lines:

libtool: link: ERROR: no information for variable 'AR' cru .libs/libutil.a .libs/mt19937ar.o .libs/sobolseq.o .libs/timer.o .libs/stop.o .libs/redblack.o .libs/qsort_r.o .libs/rescale.o

checking for ranlib... ERROR: no information for variable 'RANLIB'

However, both ar and ranlib commands work on my machine. What may be the cause of the errors?

2 Answers

You just need to install the older version of nloptr package.

For example:

packageurl<-"https://cran.r-project.org/src/contrib/Archive/nloptr/nloptr_1.2.1.tar.gz"

install.packages(packageurl, repos=NULL, type="source")

I guess you are using R 3.X. Such error is caused by package update for supporting R 4.0.

Finally I found the answer for that. I was struggling with the installation of the ggpubr packages in a Ubuntu 18.04. This answer resolve the dependencies problem.

Related