在 redHat CentOs 7 上安装 R。几个错误和依赖项我无法克服

Install R on redHat CentOs 7. Several errors and dependencies I'm unable to overcome

我正在使用 redhat centos 7 并尝试安装 R:

sudo yum install R

Returns:

Error: Package: R-java-devel-3.5.1-1.el7.x86_64 (epel)
           Requires: java-devel
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.171-2.6.13.2.el7.x86_64 (centos-base-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.181-2.6.14.5.el7.x86_64 (centos-updates-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.181-2.6.14.8.el7_5.x86_64 (centos-updates-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.191-2.6.15.4.el7_5.x86_64 (centos-updates-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.i686 (centos-base-prod)
               java-devel = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.171-7.b10.el7.i686 (centos-updates-prod)
               java-devel = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.171-8.b10.el7_5.i686 (centos-updates-prod)
               java-devel = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.i686 (centos-updates-prod)
               java-devel = 1:1.8.0
Error: Package: R-java-3.5.1-1.el7.x86_64 (epel)
           Requires: java-headless
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.171-2.6.13.2.el7.x86_64 (centos-base-prod)
               java-headless = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.5.el7.x86_64 (centos-updates-prod)
               java-headless = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.8.el7_5.x86_64 (centos-updates-prod)
               java-headless = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.191-2.6.15.4.el7_5.x86_64 (centos-updates-prod)
               java-headless = 1:1.7.0
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.161-2.b14.el7.i686 (centos-base-prod)
               java-headless = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.171-7.b10.el7.i686 (centos-updates-prod)
               java-headless = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.171-8.b10.el7_5.i686 (centos-updates-prod)
               java-headless = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.i686 (centos-updates-prod)
               java-headless = 1:1.8.0

根据错误信息我尝试安装java-devel:

sudo yum install java-devel

给出:

Package 1:java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.x86_64 is obsoleted by 2000:gd-jdk8-1.8.0_92-fcs.x86_64 which is already installed
Nothing to do

如何安装 java-devel 以安装 R?

[编辑]

Java版本:

java -version java version "1.8.0_92" Java(TM) SE Runtime Environment (build 1.8.0_92-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

[编辑]

还尝试了以下方法:

sudo yum install R-java-devel

给出:

Error: Package: R-java-devel-3.5.1-1.el7.x86_64 (epel)
           Requires: java-devel
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.171-2.6.13.2.el7.x86_64 (centos-base-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.181-2.6.14.5.el7.x86_64 (centos-updates-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.181-2.6.14.8.el7_5.x86_64 (centos-updates-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.7.0-openjdk-devel-1.7.0.191-2.6.15.4.el7_5.x86_64 (centos-updates-prod)
               java-devel = 1:1.7.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.161-2.b14.el7.i686 (centos-base-prod)
               java-devel = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.171-7.b10.el7.i686 (centos-updates-prod)
               java-devel = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.171-8.b10.el7_5.i686 (centos-updates-prod)
               java-devel = 1:1.8.0
           Available: 1:java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.i686 (centos-updates-prod)
               java-devel = 1:1.8.0

也尝试了特定版本:

sudo yum install java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.i686

返回: “包 1:java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.i686 已被 2000:gd-jdk8-1.8.0_92-fcs 淘汰。 x86_64 已安装 无事可做。

我该如何克服这些问题?也欢迎标记建议。

[编辑] 从评论中,这是 yum repolist

的输出
Loaded plugins: changelog, fastestmirror, priorities, versionlock
Determining fastest mirrors
 * epel: mirror.prgmr.com
centos-base-prod                                                                                                             9911/9911
centos-cpm-prod                                                                                                                125/125
centos-epel-prod                                                                                                           15503/15503
centos-extras-prod                                                                                                             402/402
centos-hips-prod                                                                                                                 72/72
centos-itsec-prod                                                                                                                82/82
centos-pbis-prod                                                                                                                 43/43
centos-puppet3-prod                                                                                                            242/242
centos-serverspec-prod                                                                                                           11/11
centos-updates-prod                                                                                                          1348/1348
centos_itsec_prod                                                                                                                82/82
collectd-enterprise                                                                                                            232/232
epel                                                                                                                       12743/12743
gd-prod-centos-v6-64bit-scl                                                                                                  1121/1121
gd-prod-centos-v6-64bit-tms                                                                                                    163/163
gd-prod-centos-v7-64bit-base                                                                                                 9911/9911
gd-prod-centos-v7-64bit-epel                                                                                               15503/15503
gd-prod-centos-v7-64bit-extras                                                                                                 402/402
gd-prod-centos-v7-64bit-hips                                                                                                     72/72
gd-prod-centos-v7-64bit-pan                                                                                                      83/83
gd-prod-centos-v7-64bit-sensu                                                                                                2113/2113
gd-prod-centos-v7-64bit-updates                                                                                              1348/1348
gdsnow                                                                                                                             3/3
gutils                                                                                                                           11/11
prod_centos_7_noarch_gd-snow                                                                                                       3/3
sensu-enterprise                                                                                                             4560/4560
yumrepos                                                                                                                         87/87
repo id                                                  repo name                                                              status
!centos-base-prod/x86_64                                 centos-base-prod                                                       9,910+1
!centos-cpm-prod/x86_64                                  centos-cpm-prod                                                            125
!centos-epel-prod/x86_64                                 centos-epel-prod                                                        15,503
!centos-extras-prod/x86_64                               centos-extras-prod                                                         402
!centos-hips-prod/x86_64                                 centos-hips-prod                                                            72
!centos-itsec-prod/x86_64                                centos-itsec-prod                                                           82
!centos-pbis-prod/x86_64                                 centos-pbis-prod                                                            43
!centos-puppet3-prod/x86_64                              Centos Puppet prod Packages                                                242
!centos-sclo-rh/x86_64                                   CentOS-7 - SCLo rh                                                       8,090
!centos-serverspec-prod/x86_64                           centos-serverspec-prod                                                      11
!centos-updates-prod/x86_64                              centos-updates-prod                                                    1,347+1
!centos_itsec_prod/x86_64                                centos_itsec_prod                                                           82
!collectd-enterprise/x86_64                              Enterprise Collectd Packages                                             231+1
!epel/x86_64                                             Extra Packages for Enterprise Linux 7 - x86_64                          12,743
!gd-prod-centos-v6-64bit-scl                             gd-prod-centos-v6-64bit-scl                                              1,121
!gd-prod-centos-v6-64bit-tms                             gd-prod-centos-v6-64bit-tms                                                163
!gd-prod-centos-v7-64bit-base                            gd-prod-centos-v7-64bit-base                                           9,910+1
!gd-prod-centos-v7-64bit-epel                            gd-prod-centos-v7-64bit-epel                                            15,503
!gd-prod-centos-v7-64bit-extras                          gd-prod-centos-v7-64bit-extras                                             402
!gd-prod-centos-v7-64bit-hips                            gd-prod-centos-v7-64bit-hips                                                72
!gd-prod-centos-v7-64bit-pan                             gd-prod-centos-v7-64bit-pan                                               82+1
!gd-prod-centos-v7-64bit-sensu                           gd-prod-centos-v7-64bit-sensu                                            2,113
!gd-prod-centos-v7-64bit-updates                         gd-prod-centos-v7-64bit-updates                                        1,347+1
!gdsnow                                                  prod_centos_7_noarch_gd-snow                                                 3
!gutils/x86_64                                           GUtils Packages                                                             11
!prod_centos_7_noarch_gd-snow                            prod_centos_7_noarch_gd-snow                                                 3
!prod_centos_7_x86_64_saltstack                          prod_centos_7_x86_64_saltstack                                           76+26
!sensu-enterprise/x86_64                                 Enterprise Sensu Packages                                                4,560
!yumrepos                                                Enterprise Yum Repos Repo                                                   87
repolist: 84,336

[编辑]

根据评论仅启用 epel、base 和更新回购 yum repolist all

之后我再次尝试 sudo yum install R

这产生了:

Error: Package: libRmath-devel-3.5.0-1.el7.x86_64 (centos-epel-prod)
           Requires: libRmath = 3.5.0-1.el7
           Installed: libRmath-3.5.1-1.el7.x86_64 (@epel)
               libRmath = 3.5.1-1.el7
           Available: libRmath-3.5.0-1.el7.x86_64 (centos-epel-prod)
               libRmath = 3.5.0-1.el7
Error: Package: R-java-3.5.0-1.el7.x86_64 (centos-epel-prod)
           Requires: R-core = 3.5.0-1.el7
           Installed: R-core-3.5.1-1.el7.x86_64 (@epel)
               R-core = 3.5.1-1.el7
           Available: R-core-3.5.0-1.el7.x86_64 (centos-epel-prod)
               R-core = 3.5.0-1.el7
Error: Package: 1:java-1.7.0-openjdk-1.7.0.181-2.6.14.8.el7_5.x86_64 (centos-updates-prod)
           Requires: java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.8.el7_5
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.171-2.6.13.2.el7.x86_64 (centos-base-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.171-2.6.13.2.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.5.el7.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.5.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.8.el7_5.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.8.el7_5
           Installing: 1:java-1.7.0-openjdk-headless-1.7.0.191-2.6.15.4.el7_5.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.191-2.6.15.4.el7_5
Error: Package: R-java-devel-3.5.0-1.el7.x86_64 (centos-epel-prod)
           Requires: java-devel
Error: Package: R-core-devel-3.5.0-1.el7.x86_64 (centos-epel-prod)
           Requires: R-core = 3.5.0-1.el7
           Installed: R-core-3.5.1-1.el7.x86_64 (@epel)
               R-core = 3.5.1-1.el7
           Available: R-core-3.5.0-1.el7.x86_64 (centos-epel-prod)
               R-core = 3.5.0-1.el7
Error: Package: 1:java-1.8.0-openjdk-1.8.0.171-7.b10.el7.x86_64 (centos-updates-prod)
           Requires: java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.171-7.b10.el7
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.161-2.b14.el7.x86_64 (centos-base-prod)
               java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.161-2.b14.el7
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.171-7.b10.el7.i686 (centos-updates-prod)
              ~java-1.8.0-openjdk-headless(x86-32) = 1:1.8.0.171-7.b10.el7
Error: Package: 1:java-1.7.0-openjdk-1.7.0.181-2.6.14.5.el7.x86_64 (centos-updates-prod)
           Requires: java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.5.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.171-2.6.13.2.el7.x86_64 (centos-base-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.171-2.6.13.2.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.5.el7.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.5.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.8.el7_5.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.8.el7_5
           Installing: 1:java-1.7.0-openjdk-headless-1.7.0.191-2.6.15.4.el7_5.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.191-2.6.15.4.el7_5
Error: Package: 1:java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64 (centos-updates-prod)
           Requires: java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.171-8.b10.el7_5
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.161-2.b14.el7.x86_64 (centos-base-prod)
               java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.161-2.b14.el7
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.171-7.b10.el7.i686 (centos-updates-prod)
              ~java-1.8.0-openjdk-headless(x86-32) = 1:1.8.0.171-7.b10.el7
           Available: 1:java-1.8.0-openjdk-headless-1.8.0.171-8.b10.el7_5.i686 (centos-updates-prod)
              ~java-1.8.0-openjdk-headless(x86-32) = 1:1.8.0.171-8.b10.el7_5
Error: Package: 1:java-1.7.0-openjdk-1.7.0.171-2.6.13.2.el7.x86_64 (centos-base-prod)
           Requires: java-1.7.0-openjdk-headless = 1:1.7.0.171-2.6.13.2.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.171-2.6.13.2.el7.x86_64 (centos-base-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.171-2.6.13.2.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.5.el7.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.5.el7
           Available: 1:java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.8.el7_5.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.181-2.6.14.8.el7_5
           Installing: 1:java-1.7.0-openjdk-headless-1.7.0.191-2.6.15.4.el7_5.x86_64 (centos-updates-prod)
               java-1.7.0-openjdk-headless = 1:1.7.0.191-2.6.15.4.el7_5
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

看来您从可能 'odd' 个位置安装了有冲突的包。

1:java-1.8.0-openjdk-devel-1.8.0.181-3.b13.el7_5.i686 is obsoleted by 2000:gd-jdk8-1.8.0_92-fcs.x86_64 告诉我们 gd-jdk8 提供与 java-1.8.0-openjdk-devel 相同的东西,但 R 不喜欢那个名字,想要一个合适的 javajava-devel 包。

您需要做的第一件事是禁用您启用的所有这些奇怪的回购协议,只使用 epel baseupdates 回购协议。

如果您导航到; /etc/yum.repos.d/ 您应该找到一个装满文件的文件夹。打开它们并将 enabled=1 更改为 enabled=0 这将禁用它们。

现在您应该可以 yum erase gd-jdk8 并将其与任何部门一起删除。然后你应该能够做 yum install java-devel 这应该给你正确的版本。

完成后,您将需要降级 R-corelibRmath 软件包,因为它出现在我们的 chat 中,您知道如何设法安装更新版本的软件包R也想要。

做; yum downgrade R-core libRmath 并向部门说 'yes'。这应该可以让您找到所需的正确版本。

最后做 yum install R,如果运气好,它应该会为您安装!

看起来很多包都是由内部仓库或其他东西提供的,因为你有很多前缀为 'gd' 的东西实际上并不像人们预期的那样 gd!我会与您的 operations/IT 团队谈谈,看看发生了什么。

最后请记住,您禁用了所有其他存储库 - 好吧,您现在可能希望重新启用它们,但是...如果您曾经做过 yum update,请务必确保您知道它将要做什么可能会尝试用那些 'gd' 前缀的包替换东西。

Yum 确实告诉您 is obsoleted 行出了什么问题。但是,当然,深入研究 deps 需要更多的知识,尤其是当您不确定自己在看什么并且它不是 'stock' 安装的 CentOS 时!