"Non-zero exit status" error downloading XML and RCurl R packages
Asked Answered
G

4

8

I'm having this problem:

> install.packages("RCurl")
Installing package(s) into ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/RCurl_1.95-3.tar.gz'
Content type 'application/x-gzip' length 868491 bytes (848 Kb)
opened URL
==================================================
downloaded 848 Kb

* installing *source* package ‘RCurl’ ...
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13/RCurl’
Warning in install.packages :
  installation of package 'RCurl' had non-zero exit status

The downloaded packages are in
    ‘/tmp/RtmpKyAgF8/downloaded_packages’

AND:

> install.packages("XML")
Installing package(s) into ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/XML_3.95-0.1.tar.gz'
Content type 'application/x-gzip' length 1724282 bytes (1.6 Mb)
opened URL
==================================================
downloaded 1.6 Mb

* installing *source* package ‘XML’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
No ability to remove finalizers on externalptr objects in this verison of R
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13/XML’
Warning in install.packages :
  installation of package 'XML' had non-zero exit status

The downloaded packages are in
    ‘/tmp/RtmpKyAgF8/downloaded_packages’
Groschen answered 12/12, 2012 at 18:33 Comment(4)
Try: install.packages("RCurl", contriburl = "http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.15/")Medial
@TylerRinker They're not using WindowsOff
Also make sure you have libcurl installed. RCurl depends on curl, and XML depends on RCurl.Copyholder
for example, try this sudo yum install curl curl-devel and sudo yum install libxml2 libxml2-develCopyholder
O
3

Running over CentOS 6.4, I had just successfully follow the steps:

  1. Install curl-devel and libxml with the Linux command line:
$ sudo yum install curl curl-devel
$ sudo yum -y install libxml2 libxml2-devel
  1. On R console, restart the R session and install the RCurl and XML package:
>> install.packages("RCurl")
>> install.packages("XML")
  1. Load the libraries:
>> library(RCurl)
>> library(XML)

Hope this save you a day!

Orchestral answered 3/2, 2015 at 19:0 Comment(0)
C
2

You need to match the version of RCurl and XML to the version of R you are using. Since your version of R is more one major version behind the current version, there is no reason to think the current version of XML and Rcurl will match. You can try installing from an archived version ot them. I would pick one from about a year and a half ago..... or just update your R installation.

There might be a kernel of useful information in that link from @TylerRinker despite it being for the wrong version of the wrong OS. If you trim the URL and look instead at: http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.13/ you will be able to figure out which version of the source packages to use for your out-of-date version of R on redhat.

Convenience answered 12/12, 2012 at 19:53 Comment(1)
I thought that might be the problem, I didn't pursue it further though because when I checked for newer versions of R in the console, it told me everything was up-to-date. But thanksGroschen
M
1

To install curl and xml on Ubuntu. Run

sudo apt-get install libcurl4-openssl-dev libxml2-dev

The error messages on package install in R indicate that the curl and xml libraries are not present or cannot be found.

Madelina answered 23/9, 2020 at 10:20 Comment(0)
M
0

I had a similar problem when installing RCurl. The package that had what I needed was called libcurl-devel on Amazon Linux and, according this post that answered my question, CentOS as well. It can be installed with the command sudo yum install libcurl-devel. If you are on a Debian based distribution the package may have a different name and will be install using apt.

There is probably a similar solution to your XML lib problem.

Monteverdi answered 6/1, 2015 at 1:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.