I've seen various solutions to this problem, most say to install libcurl and xml via apt-get, which I've done. Somehow I'm still having dependency issues installing devtools, hangup seems to be with xml2 and rversions:
ERROR: dependency ‘xml2’ is not available for package ‘rversions’
The downloaded source packages are in
‘/tmp/RtmpP6k0De/downloaded_packages’
Warning messages:
1: In install.packages("devtools") :
installation of package ‘rversions’ had non-zero exit status
2: In install.packages("devtools") :
The xml(2) packages I have installed are:
libxml-parser-perl
libxml2:amd64
libxml2-dev:amd64
r-cran-xml
xml-core
xml2
Just to follow up on this issue - no need for further comment. I just needed to install a newer version of r-base to get around the issues I was having. Ubuntu 14.04 will, by default, install version 3.0.2 by default, which is fairly old now. You can get around this by adding an entry to your sources.list file to point to one of the cran mirrors.
Instructions on how to do that can be found here:
http://cran.r-project.org/bin/linux/ubuntu/README
Once I did that, everything installed fine.
It isn't clear to me why @shanedp's solution is the best solution here. Ubuntu 14.04 is supported until April 2019 so shouldn't installing devtools just work? Why is this an R core bug and not a devtools bug?
@moorepants devtools imports xml2, which needs R 3.1.0 or higher. It's not the fault of devtools that Ubuntu 14.04 includes a somewhat old version of R (3.0.2).
So it's not an R bug, and it's not a devtools bug. It's just that Ubuntu's default version of R is out of date.
I disagree with you @wch. Ubuntu is the most widely used version of Linux which is released every six months and every two years it releases a long term support release, which 14.04 is the latest one. It is up to devtools to decide which versions of R to support. If devtools isn't willing to support the version of R that is available on one of the most widely installed versions of Linux, then it is a devtools bug, not Ubuntu one. As a software developer you should choose to support a reasonable range of versions for your dependencies. The choice to make devtools non-optionally dependent on xlm2 that depends on R >= 3.1.0 when R 3.0.2 is what is on Ubuntu 14.04 LTS (not to mention that 12.04 LTS is still supported and on many machines, e.g. Travis) doesn't seem that reasonable to me.
I disagree that it's a devtools bug, and I didn't say it was a Ubuntu bug. It's not a bug.
Recent versions of R are available for Ubuntu. This link is to the CRAN apt repository which provides newer versions of R: https://cran.r-project.org/bin/linux/ubuntu/
I don't think it's reasonable to expect all R packages to support whatever version of R is supplied by the Ubuntu LTS release (not to mention the previous one).
All that said, it's probable that the xml2 package would work on R 3.0 without any modifcation. But that's an issue to take up in the xml2 repo.
This should install the latest version of R on a Ubuntu system:
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt-get update
sudo apt-get install r-base
Thanks wch, I understand how to get the latest version of R on Ubuntu already. That's not really my issue. The issue is that there seems to be quite a few hoops to jump through to install devtools on the most recent LTS version of Ubuntu.
I think we just disagree on this. I'm relatively new to the R world and am ignorant of the customs. I am probably just expecting it to be like the Python world (which I spend most of my time in). Any reputable Python package supports back to 2.4/5/6 some of which are over 10 years old and still in use on many systems. We typically decide on dropping Python version support based on what different OS's provide and surveys of users. I may not be a typical R user.
I don't have the resources to support old versions of R. Unlike python, relatively few R users use linux, so windows and mac support is much more important. (And I'm not sure even python is the best example with the whole python 2 vs 3 debacle)
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
Most helpful comment
This should install the latest version of R on a Ubuntu system: