尝试安装 R 3.6.1,但在 ubuntu 中遇到问题

尝试安装 R 3.6.1,但在 ubuntu 中遇到问题

我正在 ubuntu (18.04) 中安装 R 的最新更新。我查看了许多以前的建议,但仍无法解决问题。我仍在尝试,任何帮助或建议都将非常有用。

sudo apt-get 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.1-3disco) but it is not going to be installed

          Depends: r-recommended (= 3.6.1-3disco) 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.

apt-cache policy r-base屈服:

r-base:

Installed: (none)  
Candidate: 3.6.1-3disco
Version table:    
     3.6.1-3disco 500
        500 https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/     
Packages
     3.6.1-1disco 500
        500 https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/     
Packages
     3.6.0-2disco 500
        500 https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/     
Packages
     3.6.0-1disco 500
        500 https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/     
Packages
     3.5.3.20190412-1~ubuntu18.04.1~ppa1 500
        500 http://ppa.launchpad.net/marutter/rdev/ubuntu bionic/main amd64     
Packages
        500 http://ppa.launchpad.net/marutter/rdev/ubuntu bionic/main i386     
Packages
     3.4.4-1ubuntu1 500
        500 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://in.archive.ubuntu.com/ubuntu bionic/universe i386 Packages

答案1

您尝试安装 19.04 ( disco) 版本,r-base而您正在使用 18.04 ( bionic),这就是引发错误的原因。

您必须删除disco存储库。

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

然后将其替换为bionic与您当前系统兼容的版本。

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
sudo apt-get install r-base

来源

相关内容