“没有可用的 R 包”当我在 centos 6 上使用“yum install R”时

Posted

技术标签:

【中文标题】“没有可用的 R 包”当我在 centos 6 上使用“yum install R”时【英文标题】:"No R package available" When I use "yum install R" on centos 6 【发布时间】:2019-10-10 18:59:12 【问题描述】:

我想用 yum 在 Centos 6 上安装 R。但我总是得到“没有可用的 R 包”。

下面是我的步骤:

首先,我要安装epel。

[root@host ~]# yum install epel-release
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.ca-west.mirror.fullhost.io 
* elrepo-kernel: repos.lax-noc.com 
* extras: centos.ca-west.mirror.fullhost.io 
* updates: centos.ca-west.mirror.fullhost.io
Package epel-release-6-8.noarch already installed and latest version
Nothing to do

那我要安装R:

# yum install R
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.ca-west.mirror.fullhost.io
 * elrepo-kernel: repos.lax-noc.com
 * extras: centos.ca-west.mirror.fullhost.io
 * updates: centos.ca-west.mirror.fullhost.io
No package R available
Error: Nothing to do.

我也尝试使用:

yum clean all
yum update

清洁环境。但是遇到同样的问题。

下面是repolist的信息。希望对您有所帮助。

# sudo yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ca-west.mirror.fullhost.io
 * elrepo-kernel: repos.lax-noc.com
 * extras: centos.ca-west.mirror.fullhost.io
 * updates: centos.ca-west.mirror.fullhost.io

repo id                repo name                                status
C6.0-base              CentOS-6.0 - Base                        disabled
C6.0-centosplus        CentOS-6.0 - CentOSPlus                  disabled
C6.0-contrib           CentOS-6.0 - Contrib                     disabled
C6.0-extras            CentOS-6.0 - Extras                      disabled
C6.0-updates           CentOS-6.0 - Updates                     disabled
C6.1-base              CentOS-6.1 - Base                        disabled
C6.1-centosplus        CentOS-6.1 - CentOSPlus                  disabled
C6.1-contrib           CentOS-6.1 - Contrib                     disabled
C6.1-extras            CentOS-6.1 - Extras                      disabled
C6.1-updates           CentOS-6.1 - Updates                     disabled
C6.2-base              CentOS-6.2 - Base                        disabled
C6.2-centosplus        CentOS-6.2 - CentOSPlus                  disabled
C6.2-contrib           CentOS-6.2 - Contrib                     disabled
C6.2-extras            CentOS-6.2 - Extras                      disabled\
C6.2-updates           CentOS-6.2 - Updates                     disabled
C6.3-base              CentOS-6.3 - Base                        disabled\
C6.3-centosplus        CentOS-6.3 - CentOSPlus                  disabled
C6.3-contrib           CentOS-6.3 - Contrib                     disabled
C6.3-extras            CentOS-6.3 - Extras                      disabled
C6.3-updates           CentOS-6.3 - Updates                     disabled
C6.4-base              CentOS-6.4 - Base                        disabled
C6.4-centosplus        CentOS-6.4 - CentOSPlus                  disabled
C6.4-contrib           CentOS-6.4 - Contrib                     disabled
C6.4-extras            CentOS-6.4 - Extras                      disabled
C6.4-updates           CentOS-6.4 - Updates                     disabled
C6.5-base              CentOS-6.5 - Base                        disabled
C6.5-centosplus        CentOS-6.5 - CentOSPlus                  disabled
C6.5-contrib           CentOS-6.5 - Contrib                     disabled
C6.5-extras            CentOS-6.5 - Extras                      disabled
C6.5-updates           CentOS-6.5 - Updates                     disabled
C6.6-base              CentOS-6.6 - Base                        disabled
C6.6-centosplus        CentOS-6.6 - CentOSPlus                  disabled
C6.6-contrib           CentOS-6.6 - Contrib                     disabled
C6.6-extras            CentOS-6.6 - Extras                      disabled
C6.6-updates           CentOS-6.6 - Updates                     disabled
C6.7-base              CentOS-6.7 - Base                        disabled
C6.7-centosplus        CentOS-6.7 - CentOSPlus                  disabled
C6.7-contrib           CentOS-6.7 - Contrib                     disabled
C6.7-extras            CentOS-6.7 - Extras                      disabled
C6.7-updates           CentOS-6.7 - Updates                     disabled
C6.8-base              CentOS-6.8 - Base                        disabled
C6.8-centosplus        CentOS-6.8 - CentOSPlus                  disabled
C6.8-contrib           CentOS-6.8 - Contrib                     disabled
C6.8-extras            CentOS-6.8 - Extras                      disabled
C6.8-updates           CentOS-6.8 - Updates                     disabled
C6.9-base              CentOS-6.9 - Base                        disabled
C6.9-centosplus        CentOS-6.9 - CentOSPlus                  disabled
C6.9-contrib           CentOS-6.9 - Contrib                     disabled
C6.9-extras            CentOS-6.9 - Extras                      disabled
C6.9-updates           CentOS-6.9 - Updates                     disabled
base                   CentOS-6 - Base                          enabled: 6,712+1
base-debuginfo         CentOS-6 - Debuginfo                     disabled
c6-media               CentOS-6 - Media                         disabled
centosplus             CentOS-6 - Plus                          disabled
contrib                CentOS-6 - Contrib                       disabled
elrepo                 ELRepo.org Community Enterprise Linux Re disabled
elrepo-extras          ELRepo.org Community Enterprise Linux Ex disabled
elrepo-kernel          ELRepo.org Community Enterprise Linux Ke enabled:      13
elrepo-testing         ELRepo.org Community Enterprise Linux Te disabled
epel                   Extra Packages for Enterprise Linux 6 -  disabled
epel-debuginfo         Extra Packages for Enterprise Linux 6 -  disabled
epel-source            Extra Packages for Enterprise Linux 6 -  disabled
epel-testing           Extra Packages for Enterprise Linux 6 -  disabled
epel-testing-debuginfo Extra Packages for Enterprise Linux 6 -  disabled
epel-testing-source    Extra Packages for Enterprise Linux 6 -  disabled
extras                 CentOS-6 - Extras                        enabled:      46
fasttrack              CentOS-6 - fasttrack                     disabled
updates                CentOS-6 - Updates                       enabled:   455+8

repolist: 7,226
Exit code: 0

我可以使用“yum install gcc”,而且效果很好。

【问题讨论】:

R packages are available from the EPEL repositories。你在你的 CentOS 机器上启用了 EPEL repos 吗? sudo yum install epel-release?然后使用sudo yum install R 重试。 谢谢。我试过了,还是失败了。 “我试过了,还是失败了。”什么失败了?启用 EPEL 存储库?您是否验证过它们已使用sudo yum repolist 启用?请具体并在主帖中添加所有这些关键信息(而不是在 cmets 中)。 SO上有各种其他线程处理在CentOS 6(类似系统)上安装R。你看过那些吗?例如。 here, here 是的,我相信这就是问题所在。尝试使用yum-config-manager --enable epel 启用;之后,sudo yum install R 应该会找到 R。 @MauritsEvers 谢谢。按照你的建议解决了。 【参考方案1】:

尝试运行以下命令:

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

然后运行以下命令:

sudo yum install R

希望对你有帮助

【讨论】:

谢谢。但我还是犯了同样的错误。 @kanpu 你启用了repo吗?

以上是关于“没有可用的 R 包”当我在 centos 6 上使用“yum install R”时的主要内容,如果未能解决你的问题,请参考以下文章

在 Centos 6 上使用 Apache 进行反向代理

centos 6.5 上 Apache 2.2.15 上的 Django

如何在centos 6上恢复系统gcc编译器

openshift origin v0.3.3 在 centos 6.6 上启动 docker registry pod 时出错

在 centos 6 中安装编译器 gfortran

使用CentOS 6编译ACE / TAO 1.2库