My Ubuntu and R versions:
alvas@ubi:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
alvas@ubi:~$ R
> version
_
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 2.2
year 2015
month 08
day 14
svn rev 69053
language R
version.string R version 3.2.2 (2015-08-14)
nickname Fire Safety
In R, using Ubuntu, when I tried to install readr
:
> install.packages('readr')
Installing package into ‘/home/alvas/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependency ‘curl’
trying URL 'https://mirrors.ebi.ac.uk/CRAN/src/contrib/curl_0.9.4.tar.gz'
Content type 'application/x-gzip' length 245598 bytes (239 KB)
==================================================
downloaded 239 KB
trying URL 'https://mirrors.ebi.ac.uk/CRAN/src/contrib/readr_0.2.2.tar.gz'
Content type 'application/x-gzip' length 146554 bytes (143 KB)
==================================================
downloaded 143 KB
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
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=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/alvas/R/x86_64-pc-linux-gnu-library/3.2/curl’
ERROR: dependency ‘curl’ is not available for package ‘readr’
* removing ‘/home/alvas/R/x86_64-pc-linux-gnu-library/3.2/readr’
The downloaded source packages are in
‘/tmp/Rtmp2Ke6na/downloaded_packages’
Warning messages:
1: In install.packages("readr") :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("readr") :
installation of package ‘readr’ had non-zero exit status
> q()
So when I tried to install libcurl4
, Somehow my dependency tree screwed up:
alvas@ubi:~$ sudo apt-get install libcurl4-openssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libcurl4-openssl-dev : Depends: libcurl3 (= 7.35.0-1ubuntu2) but 7.35.0-1ubuntu2.5 is to be installed
Depends: libkrb5-dev but it is not going to be installed
Depends: librtmp-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I've tried:
alvas@ubi:~$ sudo apt-get -y build-dep libcurl4-openssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'curl' as source package instead of 'libcurl4-openssl-dev'
E: Unable to find a source package for curl
It didn't work so I clean:
alvas@ubi:~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
And then I did this:
alvas@ubi:~$ sudo apt-get install libcurl4-openssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libcurl4-openssl-dev : Depends: libcurl3 (= 7.35.0-1ubuntu2) but 7.35.0-1ubuntu2.5 is to be installed
Depends: libkrb5-dev but it is not going to be installed
Depends: librtmp-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages
So I tried installing the dependency:
alvas@ubi:~$ sudo apt-get install librtmp-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
librtmp-dev : Depends: libgnutls-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
How can I resolve the dirty dependency tree so as to install readr
in R successfully?
The following two commands solved my problem
apt-get -y build-dep libcurl4-gnutls-dev apt-get -y install libcurl4-gnutls-dev
Whenever you have a dependency problem, run:
Now, to install
readr
in R, and for the case of Ubuntu 16.04 and R version 3.2.3 (2015-12-10), I had to do the following: