在Ubuntu 18.14 LTS上安装R 3.6.2的未满足依赖项

时间:2020-02-17 20:32:39

标签: r ubuntu-18.04

我使用18.04.4 LTS(仿生海狸)

我想将我的R版本从3.4.4升级到3.6.2,但是现在我根本没有R。

这是我的动作

第一步:

sudo apt update
sudo apt-get upgrade
sudo apt-get dist-upgrade

2步:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

3步:

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'

返回:

Hit:1 http://ua.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ua.archive.ubuntu.com/ubuntu bionic-updates InRelease                     
Hit:3 http://ua.archive.ubuntu.com/ubuntu bionic-backports InRelease                   
Hit:4 http://cran.rstudio.com/bin/linux/ubuntu bionic-cran35/ InRelease                
Hit:5 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease                      
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease                      
Hit:7 https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ InRelease
Hit:8 https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/ InRelease
Hit:9 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Reading package lists... Done

4步:

sudo apt update
sudo apt install r-base

返回:

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:
  r-base : Depends: r-base-core (>= 3.6.2-1xenial) but it is not going to be installed
      Depends: r-recommended (= 3.6.2-1xenial) but it is not going to be installed
      Recommends: r-base-html but it is not going to be installed
 E: Unable to correct problems, you have held broken packages.

然后我尝试:

R --version

返回:

Command 'R' not found, but can be installed with:
sudo apt install r-base-core

我尝试:

 sudo apt install r-base-core


 The following packages have unmet dependencies:
  r-base-core : Depends: libreadline6 (>= 6.0) but it is not 
  installable
           Recommends: r-recommended but it is not going to be 
  installed
           Recommends: r-base-dev but it is not going to be 
  installed
  E: Unable to correct problems, you have held broken packages.

2 个答案:

答案 0 :(得分:0)

您可以尝试两件事:

  1. 就像您已经安装的一样,仅安装到sudo apt-get dist-upgrade。它将列出候选升级,您仍然可以退出。优势:它为您解决了相互依赖的升级。

  2. 继续执行您的操作,但列出受影响的程序包,即sudo apt-get install r-base r-recommended r-base-hmtml。这将起作用,但是可能需要几个迭代步骤。

答案 1 :(得分:0)

我看了看etc / apt / sources.list文件,发现我重复了相同的存储库。我删除了两行,问题就解决了。