[r] "installation of package 'FILE_PATH' had non-zero exit status" in R

By installing the package in R using the following command:

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

I got the following error:

Installing package into ‘/home/p/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified) Errore in rawToChar(block[seq_len(ns)]) : embedded nul in string: 'PK\003\004\024\0\002\0\b\0]\xadVCr\xcb\xea\xfcR\0\0\0\xa7\0\0\0\027\0\0\0bivpois-Rcode/.Rhistory+\xce/-JN\xd5PO\xca,+\xc8\xcf,\xd6+IL\xcaI\xd5\vR\xd7\xe4\xe5*\x86J\xe5\xe4\xea%\025`\b\xa5d\xa2\v?\xe7%\xe6' Warning message: In install.packages("/home/p/Research/14_bivpois-Rcode.zip", repos = NULL, : installation of package ‘/home/p/Research/14_bivpois-Rcode.zip’ had non-zero exit status

The R version is the 3.0.2 (2013-09-25) -- "Frisbee Sailing" and the OS is Linux Mint (UNIX).

Why Do I get that error and what does it mean:

installation of package ‘/home/p/Research/14_bivpois-Rcode.zip’ had non-zero exit status

in R?

You can find the package here and the file 14_bivpois-Rcode.zip is the source.

I tried to install that locally and the path is the correct one.

Any suggestion to install that package in UNIX?

This question is related to r installation package

The answer is


I was having a similar problem trying to install a package called AED. I tried using the install.packages() command:

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

but kept getting the following warning message:

Warning message:
In install.packages("/Users/blahblah/R-2.14.0/AED",  :
installation of package ‘/Users/blahblah/R-2.14.0/AED’ had
non-zero exit status

It turned out the folder 'AED' had another folder inside of it that hadn't been uncompressed. I just uncompressed it and tried installing the package again and it worked.


I have had the same problem with a specific package in R and the solution was I should install in the ubuntu terminal libcurl. Look at the information that appears above explaining to us that curl package has error installation.

I knew this about the message:

Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

To install it I used the net command:

sudo apt-get install libcurl4-openssl-dev

Sometimes we can not install a specific package in R because we have problems with packages that must be installed previously as curl package. To know if we should install it we should check the warning errors such as: installation of package ‘curl’ had non-zero exit status.

I hope I have been helpful


For those of you who are using MacOS and like me perhaps have been circling the internet as to why some R packages do not install here is a possible help.

If you get a non-zero exit status first check to ensure all dependencies are installed as well. Read through the messaging. If that is checked off, then look for indications such as gfortran: No such a file or directory. That might be due to Apple OS compiler issues that some packages will not install unless you use their binary version. Look for binary zip file in the package cran.r-project.org page, download it and use the following command to get the package installed:

install.packages("/PATH/zip file ", repos = NULL, type="source")


You can try using command : install.packages('*package_name', dependencies = TRUE)

For example is you have to install 'caret' package in your R machine in linux : install.packages('caret', dependencies = TRUE)

Doing so, all the dependencies for the package will also be downloaded.


Simple install following libs on your linux.
curl: sudo apt-get install curl
libssl-dev: sudo apt-get install libssl-dev
libcurl: sudo apt-get install libcurl4-openssl-dev
xml2: sudo apt-get install libxml2-dev


I had the same problem, but the answer from @little_chemist helped me sorting it out. When installing packages from a file in a unix OS (Ubuntu 18.04 for me), the file can not be zipped. You are using:

install.packages("/home/p/Research/14_bivpois-Rcode.zip", repos = NULL, type="source")

I noticed the solution was as simple as unzipping the package. Additionally, unzip all (installation related?) packages inside, as @little_chemist points out. Then use install.packages:

install.packages("/home/p/Research/14_bivpois-Rcode", repos = NULL, type="source")

Hope it helps!


Try use this:

    apt-get install r-base-dev

It will be help. After then I could makeinstall.packages('//package_name')


Did you check the gsl package in your system. Try with this:

ldconfig-p | grep gsl

If gsl is installed, it will display the configuration path. If it is not in the standard path /usr/lib/ then you need to do the following in bash:

export PATH=$PATH:/your/path/to/gsl-config 

If gsl is not installed, simply do

sudo apt-get install libgsl0ldbl
sudo apt-get install gsl-bin libgsl0-dev

I had a problem with the mvabund package and this fixed the error

Cheers!


Examples related to r

How to get AIC from Conway–Maxwell-Poisson regression via COM-poisson package in R? R : how to simply repeat a command? session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium How to show code but hide output in RMarkdown? remove kernel on jupyter notebook Function to calculate R2 (R-squared) in R Center Plot title in ggplot2 R ggplot2: stat_count() must not be used with a y aesthetic error in Bar graph R multiple conditions in if statement What does "The following object is masked from 'package:xxx'" mean?

Examples related to installation

You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) Conda version pip install -r requirements.txt --target ./lib How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" PackagesNotFoundError: The following packages are not available from current channels: Tensorflow import error: No module named 'tensorflow' Downgrade npm to an older version Create Setup/MSI installer in Visual Studio 2017 how to install tensorflow on anaconda python 3.6 Application Installation Failed in Android Studio How to install pip for Python 3.6 on Ubuntu 16.10?

Examples related to package

ModuleNotFoundError: No module named 'sklearn' Python: How to pip install opencv2 with specific version 2.4.9? Relative imports - ModuleNotFoundError: No module named x Is __init__.py not required for packages in Python 3.3+ "pip install unroll": "python setup.py egg_info" failed with error code 1 Unable to Install Any Package in Visual Studio 2015 beyond top level package error in relative import How can I specify the required Node.js version in package.json? "installation of package 'FILE_PATH' had non-zero exit status" in R Error in installation a R package