Most installation of packages have non-zero exit status

Most package I try to install have non-zero exit status. I tried hdi, leaps, glmnet. Every attempt to install the packages has failed.

I tried:

update.packages(repos='http://cran.rstudio.com/', ask=FALSE, checkBuilt=TRUE)

install.packages("Rcpp", type = "source")

I always have to work with an online R compiler which is very annoying. What could help here? Thank you.

Can you give an specific example? "non-zero exit status" simply means that the package has not been installed, it tells us nothing about the cause, we need to see a complete output message to see what is going on.

1 Like

Thank you for your fast answer. The output message is:

For package hdi

library(hdi)
Fehler in library(hdi) : es gibt kein Paket namens ‘hdi’ 

For lars:

install.packages("leaps")
Installing package into ‘/home/gauss/R/x86_64-pc-linux-gnu-library/3.4’  (as ‘lib’ is unspecified)
versuche URL 'https://cloud.r-project.org/src/contrib/leaps_3.1.tar.gz'
Content type 'application/x-gzip' length 28558 bytes (27 KB)
==================================================
downloaded 27 KB

* installing *source* package ‘leaps’ ...
** Paket ‘leaps’ erfolgreich entpackt und MD5 Summen überprüft
** libs
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c leaps.f -o leaps.o
gfortran   -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong  -c leapshdr.f -o leapshdr.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o leaps.so leaps.o leapshdr.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: -lgfortran kann nicht gefunden werden
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'leaps.so' failed
make: *** [leaps.so] Error 1
ERROR: compilation failed for package ‘leaps’
* removing ‘/home/gauss/R/x86_64-pc-linux-gnu-library/3.4/leaps’
Warning in install.packages :
  installation of package ‘leaps’ had non-zero exit status

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

`

I have the gfortran version 4:7.4.0-1ubuntu2.3.

I had the GNU Fortran Version 7.5.0, which differed from my gcc and g++ versions (8.4.0). I updated it.

 sudo apt-get install gfortran-8

After restarting R, my problem get solved. Thanks for the help.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

you say you have gfortran, but the error message seems clear that it can't find it where it expects it, so I would focus on that

1 Like