Erro de dependências não atendidas ao instalar o pacote “readr” em R

3

Minhas versões do Ubuntu e do R:

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 

Em R, usando o Ubuntu, quando tentei instalar o 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()

Então, quando eu tentei instalar libcurl4 , de alguma forma minha árvore de dependência errou:

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.

Eu tentei:

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

Não funcionou, então limpei:

alvas@ubi:~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree       
Reading state information... Done

E então eu fiz isso:

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

Então eu tentei instalar a dependência:

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.

Como posso resolver a árvore de dependências sujas para instalar readr em R com sucesso?

    
por alvas 06.12.2015 / 04:52

2 respostas

2

Sempre que você tiver um problema de dependência, execute:

sudo apt-get install -f

Agora, para instalar readr em R e, para o caso do Ubuntu 16.04 e R versão 3.2.3 (2015-12-10), tive que fazer o seguinte:

sudo apt-get install libcurl3
sudo apt-get install libcurl4-gnutls-dev 
    
por user308164 07.12.2016 / 11:14
1

Os dois comandos a seguir resolveram meu problema

apt-get -y build-dep libcurl4-gnutls-dev apt-get -y install libcurl4-gnutls-dev

    
por Anderson Zhu 16.04.2016 / 00:54