我有一个装有旧版本 (3.0.2) R 的 ec2 实例,我正在尝试将其更新到最新版本 (3.1.1)。这在默认 yum repo 中不可用,但在 EPEL 下可用。
安装的版本是3.0.2:
[hadoop@ip-172-31-19-15 ~]$ yum list R-core
Loaded plugins: priorities, update-motd, upgrade-helper
970 packages excluded due to repository priority protections
Installed Packages
R-core.x86_64 3.0.2-1.17.amzn1 @amzn-main
Available Packages
R-core.i686 3.0.2-1.17.amzn1 amzn-main
这些是 repos
[hadoop@ip-172-31-19-15 ~]$ yum repolist
Loaded plugins: priorities, update-motd, upgrade-helper
970 packages excluded due to repository priority protections
repo id repo name status
!amzn-main/latest amzn-main-Base 4,801
!amzn-updates/latest amzn-updates-Base 1,497
epel/x86_64 Extra Packages for Enterprise Linux 6 - x86_64 10,139+970
repolist: 16,437
指定 epel repo,我可以看到版本 3.1.1,它也被列出这里
sudo yum --disablerepo="*" --enablerepo="epel" list R-core
Loaded plugins: priorities, update-motd, upgrade-helper
Installed Packages
R-core.x86_64 3.0.2-1.17.amzn1 @amzn-main
Available Packages
R-core.i686 3.1.1-3.el6 epel
R-core.x86_64 3.1.1-3.el6
但是,当我尝试使用安装时sudo yum --disablerepo="*" --enablerepo="epel" install R-core
出现以下错误:
--> Finished Dependency Resolution
Error: Package: R-java-3.1.1-3.el6.x86_64 (epel)
Requires: java-1.5.0-gcj
Error: Package: R-core-devel-3.1.1-3.el6.x86_64 (epel)
Requires: libicu-devel
Error: Package: R-core-devel-3.1.1-3.el6.x86_64 (epel)
Requires: tcl-devel
Error: Package: R-core-devel-3.1.1-3.el6.x86_64 (epel)
Requires: tk-devel
Error: Package: R-core-3.1.1-3.el6.x86_64 (epel)
Requires: libicuuc.so.42()(64bit)
Error: Package: R-core-3.1.1-3.el6.x86_64 (epel)
Requires: xdg-utils
Error: Package: R-core-3.1.1-3.el6.x86_64 (epel)
Requires: libicui18n.so.42()(64bit)
Error: Package: R-core-3.1.1-3.el6.x86_64 (epel)
Requires: libtcl8.5.so()(64bit)
Error: Package: R-core-3.1.1-3.el6.x86_64 (epel)
Requires: libtk8.5.so()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
据推测这是由于禁用* repo 并且仅启用 epel 导致的,这可能会阻止找到某些依赖项,我不得不这样做,否则它只能从 amzn_main 中找到 3.0.2。
我应该使用什么正确的命令来从 epel repo 安装 3.1.1?
答案1
# yum install yum-priorities
需要为所有设置的存储库添加优先级。转到/etc/yum.repos.d编辑所有文件并添加优先事项
数字越低,重要性越高 —— 因此 EPEL 的数字最低。
例子:
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
priority=10
答案2
EPEL 与 Amazon Linux 不兼容。在早期,Amazon Linux 看起来更像 CentOS,但现在两者已经大不相同了。