简体   繁体   English

在 Linux 服务器上安装 R

[英]Install R in Linux Server

I have tried install R in Linux operated server system.我曾尝试在 Linux 操作系统中安装 R。 I have download latest version of R from here我从这里下载了最新版本的 R

Then I started to install然后我开始安装

`./configure --prefix=$HOME/R-3.4.1 --enable-R-shlib `./configure --prefix=$HOME/R-3.4.1 --enable-R-shlib

And I get configure error: "zlib library and headers are required".我收到配置错误:“需要 zlib 库和头文件”。

I install and configure zlib.1.2.11 and try again but still get same error.我安装并配置了 zlib.1.2.11 并重试,但仍然出现相同的错误。

I couldn't solve this problem.我无法解决这个问题。

Note - Considering your situation and provided details, I see these possible solutions :注意 - 考虑到您的情况和提供的详细信息,我看到了这些可能的解决方案:

1 - Ubtunu(Debian-based) system, Installing from package manager : 1 - Ubtunu(基于 Debian)系统,从包管理器安装:

This require the user to have installation rights on your machine.这要求用户在您的机器上具有安装权限。

Open a terminal, and type this command.打开终端,然后键入此命令。

sudo apt update
sudo apt install r-base

This will update your packages info and install R main package (r-base).这将更新您的软件包信息并安装 R 主软件包 (r-base)。 As pointed out by @Touqeer you can install only the dependencies with this command.正如@Touqeer 所指出的,您只能使用此命令安装依赖项。

sudo apt build-dep r-base

2 - Ubuntu(Debian-based) system, Installing from source : 2 - Ubuntu(基于 Debian)系统,从源安装:

If you don't have installation rights on your machine, you can proceed with source code.如果您在您的机器上没有安装权限,您可以继续使用源代码。 Thanks to the folks at AskUbuntu for this part.感谢AskUbuntu的人们对这部分的贡献 Dont forget to change the package version on the following code if necessary.如有必要,请不要忘记更改以下代码中的包版本。

wget http://cran.rstudio.com/src/base/R-3/R-3.4.1.tar.gz
tar xvf R-3.4.1.tar.gz
cd R-3.4.1
./configure --prefix=$HOME/R
make && make install

This will download the required files from CRAN directly.这将直接从 CRAN 下载所需的文件。 Next it will unzip the files into a directory.接下来,它将文件解压缩到一个目录中。 After this cd command will bring you into the created directory.cd命令将带您进入创建的目录。 Finally, you will install R with the ./configure and the make && make install commands.最后,您将使用./configuremake && make install命令安装 R。

Always check that you are in the good working directory.始终检查您是否在良好的工作目录中。 If the ./configure or make && make install commands fails, you may have dependencies problems.如果./configuremake && make install命令失败,你可能有依赖问题。 Basicaly, you will have to do approximatively the same procedure with the missing package and so on with his dependencies.基本上,您将不得不对丢失的包执行大致相同的过程,等等。 @knb at AskUbuntu propose to change the configuration file to something like configure -- with-zlib=$HOME/zlib-1.2.11 ,using the zlib dependency as example, to force a dependency path into the config file. AskUbuntu 的@knb 建议将配置文件更改为类似configure -- with-zlib=$HOME/zlib-1.2.11 ,以 zlib 依赖项为例,强制将依赖项路径添加到配置文件中。

Keep us posted!随时关注我们!

I tried this, and at the ./configure step, the last message was: configure: error: No F77 compiler found and then make: *** No targets specified and no makefile found.我试过了,在 ./configure 步骤,最后一条消息是:configure: error: No F77 compiler found 然后 make: *** No targets specified and no makefile found. Stop.停止。

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

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