简体   繁体   English

如何在 Amazon Linux 2 上安装更新版本的 R

[英]How to install newer version of R on Amazon Linux 2

For whatever reason, Amazon moved R to the so-called "Extras Library" so you can't install R using sudo yum install -y R anymore.无论出于何种原因,亚马逊将 R 移至所谓的“Extras 库”,因此您无法再使用sudo yum install -y R Instead, you have to do sudo amazon-linux-extras install R3.4 .相反,您必须执行sudo amazon-linux-extras install R3.4 As a result, I can only install R 3.4.3 when the newest stable release is 3.6.1, and so many R libraries can't even be installed because the version is too low.结果我只能在最新稳定版3.6.1的时候安装R 3.4.3,而且因为版本太低,很多R库都装不下。 Is there any good and clean way to install the latest version of R and skip Amazon's package manager?有没有什么好的和干净的方法来安装最新版本的 R 并跳过亚马逊的包管理器? Thanks!谢谢!

Try this on Amazon Linux 2在 Amazon Linux 2 上试试这个

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

Use amazon-linux-extras which installs R4.0.2:使用安装 R4.0.2 的 amazon-linux-extras:

amazon-linux-extras install R4

You may need root:您可能需要root:

sudo amazon-linux-extras install R4

I've tried setting up R 3.6.x on a docker container that uses the amazonlinux image.我尝试在使用 amazonlinux 映像的 docker 容器上设置 R 3.6.x。 My approach was to get the R source file from the below link and install from source我的方法是从下面的链接中获取 R 源文件并从源代码安装

cd /tmp/ 
wget https://cloud.r-project.org/src/base/R-3/R-3.6.3.tar.gz
tar -zxf R-3.6.3.tar.gz
cd /tmp/R-3.6.3
./configure --without-libtiff --without-lapack --without-ICU --disable-R-profiling --disable-nls
make
make install

you will need to yum install some dependencies, like 'make', which doesn't seem to come with aws amazonlinux docker image (which i think mirrors the EC2 instance AMI image you are referring to).您将需要 yum 安装一些依赖项,例如“make”,它似乎没有附带 aws amazonlinux docker 映像(我认为它反映了您所指的 EC2 实例 AMI 映像)。

The above kind of worked for me in that i had a working R3.6 installation, but it didnt allow me use it with rshiny server, so i'm reverting to the shipped 3.4.3 version.上述类型对我有用,因为我有一个有效的 R3.6 安装,但它不允许我将它与 rshiny 服务器一起使用,所以我要恢复到附带的 3.4.3 版本。

tl;dr: you'll probably have to manually download the source files and install the desired R version from source, and throw in some build dependencies as well. tl;dr:您可能需要手动下载源文件并从源代码安装所需的 R 版本,并加入一些构建依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM