之前的R版本太旧,不少包装不上,需要安装新版本的R:

R --version
R version 3.6.0 (2019-04-26) -- "Planting of a Tree"

于是下载最新版R:

因为没有证书,需要加上最后面的参数.

wget https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/base/R-4/R-4.2.2.tar.gz --no-check-certificate

或者使用

yum install -y ca-certificates

第一次配制报错:

./configure --enable-R-shlib --prefix=/opt/R/R-4.2.2 --with-x=no
...
checking for readline/history.h... no
checking for readline/readline.h... no
checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... no
checking for main in -ltinfo... no
checking for main in -ltermcap... no
checking for main in -ltermlib... no
checking for rl_callback_read_char in -lreadline... no
configure: error: --with-readline=yes (default) and headers/libs are not available

这是因为没有装readline这个包:

sudo yum install readline-devel
...
Running transactionInstalling : ncurses-devel-5.9-14.20130511.el7_4.x86_64                   1/2 Installing : readline-devel-6.2-11.el7.x86_64                             2/2 Verifying  : readline-devel-6.2-11.el7.x86_64                             1/2 Verifying  : ncurses-devel-5.9-14.20130511.el7_4.x86_64                   2/2 Installed:readline-devel.x86_64 0:6.2-11.el7                                            Dependency Installed:ncurses-devel.x86_64 0:5.9-14.20130511.el7_4                                  Complete!

然后继续配置:

./configure --enable-R-shlib --prefix=/opt/R/R-4.2.2 --with-x=no  --with-readline=yes --with-libpng=yes --with-blas
...
R is now configured for x86_64-pc-linux-gnuSource directory:            .Installation directory:      /opt/R/R-4.2.2C compiler:                  gcc -std=gnu11  -g -O2Fortran fixed-form compiler: gfortran  -g -O2Default C++ compiler:        g++ -std=gnu++11  -g -O2C++11 compiler:              g++ -std=gnu++11  -g -O2C++14 compiler:                 C++17 compiler:                 C++20 compiler:                 Fortran free-form compiler:  gfortran  -g -O2Obj-C compiler:         Interfaces supported:        tcltkExternal libraries:          pcre2, readline, curlAdditional capabilities:     PNG, JPEG, TIFF, NLS, ICUOptions enabled:             shared R library, shared BLAS, R profilingCapabilities skipped:        cairoOptions not enabled:         memory profilingRecommended packages:        yesconfigure: WARNING: neither inconsolata.sty nor zi4.sty found: PDF vignettes and package manuals will not be rendered optimally

最后一段警告信息让人不爽. 这是latex的sty包没装,于是装一下:

wget http://mirrors.ctan.org/fonts/inconsolata.zipunzip inconsolata.zip
Archive:  inconsolata.zipcreating: inconsolata/...inflating: inconsolata/tex/inconsolata.sty ...cp -R inconsolata/* /usr/share/texmf/sudo yum install texlivesudo texhash
texhash: Updating /usr/share/texlive/texmf/ls-R...
texhash: Updating /usr/share/texlive/texmf-config/ls-R...
texhash: Updating /usr/share/texlive/texmf-dist/ls-R...
texhash: Updating /usr/share/texlive/texmf-local///ls-R...
texhash: Updating /usr/share/texlive/texmf-var/ls-R...
texhash: Done.

然后再配置就不会有警告信息了:

./configure --enable-R-shlib --prefix=/opt/R/R-4.2.2 --with-x=no  --with-readline=yes --with-libpng=yes --with-blas
...
R is now configured for x86_64-pc-linux-gnuSource directory:            .Installation directory:      /opt/R/R-4.2.2C compiler:                  gcc -std=gnu11  -g -O2Fortran fixed-form compiler: gfortran  -g -O2Default C++ compiler:        g++ -std=gnu++11  -g -O2C++11 compiler:              g++ -std=gnu++11  -g -O2C++14 compiler:                 C++17 compiler:                 C++20 compiler:                 Fortran free-form compiler:  gfortran  -g -O2Obj-C compiler:         Interfaces supported:        tcltkExternal libraries:          pcre2, readline, curlAdditional capabilities:     PNG, JPEG, TIFF, NLS, ICUOptions enabled:             shared R library, shared BLAS, R profilingCapabilities skipped:        cairoOptions not enabled:         memory profilingRecommended packages:        yes

configuare 参数说明:

–enable-R-shlib 表示生成libR.so库,当需要进行gcc等编译的时候很重要,确保之后安装R-studio-server时会出现 找不到"lib.so"文件的错误。

–with-readline=yes表示用于R shell条件下的调试优化

–with-libpng=yes表示可导出png图片

–with-blas表示优化R运算并生成libRblas.so库

–prefix 设定安装路径,否则make install会去安装到/usr/lib文件夹下,非root用户没有权限.

然后再

make
make install

最后将R指向新装的R

which R
sudo mv /usr/bin/R /usr/bin/R.3.6
ln -s /opt/R/R-4.2.2/bin/R /usr/bin/R
RR version 4.2.2 (2022-10-31) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Innocent and Trusting...ok....重启Rstudio...

但悲剧还没结束, Rstudio版本太旧, 不匹配R4.2.2里的图形引擎:

最后的解决方案是退回到4.0.2:

ref:

Ubntu 14.04 LTS 下编译安装R Source Code_Linux教程_Linux公社-Linux系统门户网站

全网最全:新处理器安装R所出现的报错问题 - 简书

linux服务器上装r,linux服务器安装R语言及Rstudio server_weixin_39595085的博客-CSDN博客

centos7下为Rstudio安装多版本R相关推荐

  1. centos7下安装低版本mysql_centos7下使用yum安装制定版本mysql

    一.准备mysql镜像源 到官网找mysql的yum源 wget https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm r ...

  2. R软件与RStudio安装(版本R-4.2.2)Windows10

    目录 一.R软件的安装 (一)R软件安装(R开发环境安装) 二.RStudio的安装 (一)下载RStudio (二)安装RStudio R 语言是一款为数学研究工作者设计的处理数据的完全面向对象的编 ...

  3. Linux:安装最新版本R + Rstudio成功使用最新R

    手把手教你如何在 Linux 上源码安装最新版本 R 下载 R 下载最新版本R(R-4.0.4.tar.gz) 解压后,在 /R-4.0.4目录下运行 $CFLAGS="-O3 -fPIC& ...

  4. 第一篇:centos7下svn的安装与卸载

    2019独角兽企业重金招聘Python工程师标准>>> 第一篇:centos7下svn的安装与卸载 2017年11月29日 00:10:53 独家记忆ly 阅读数:6108 这是我的 ...

  5. Centos7 下nexus的安装和使用

    文章目录 Centos7 下nexus的安装和使用 1.安装JDK 1.1查看当前linux是否安装java 1.2 上传jdk到linux文件目录 1.3 配置环境变量 (1)修改/etc/prof ...

  6. Centos7下keycloak的安装以及使用

    Centos7下keycloak的安装以及使用 环境说明 java版本:1.8.0_101 mysql版本:mysql Ver 8.0.21 for Linux on x86_64 (MySQL Co ...

  7. 手把手教你如何在 Linux 上源码安装最新版本 R

    如果你使用的 Linux 系统 GCC 版本太低,又没有 root 权限(即使有 root 权限又担心升级 GCC 带来的风险):同时你又不想额外多安装多一个 Anaconda 或者 Minicond ...

  8. linux安装多版本php_Linux系统下为Nginx安装多版本PHP

    我们在安装配置服务器LNPM环境时应该考虑到PHP多版本并存的问题,下面是实现Linux系统下为Nginx安装多版本PHP的实现方法 linux版本:64位CentOS 6.4 Nginx版本:ngi ...

  9. linux防火墙安装httpd配置,CentOS7下 Apache的安装配置方法

    前些天安装了Nginx,为了好玩我就又安装Apache,Apache的安装还算顺利.在此做一下学习记录和经验分享. 一.安装httpd 1.先查看一下系统有没有已经安装了httpd的,如果啥都没查到, ...

最新文章

  1. ThinkPHP 3.2.2 实现持久登录 ( 记住我 )
  2. Hibenate工具类(实现增/删/改/查)
  3. QT中动态库和静态库使用
  4. ssl1463-公共子串【各种dp之1】
  5. Android笔记 fragment入门 动态加载fragment demo+ 判断横竖屏
  6. java非负数校验_JavaScript正则表达式校验非负整数实例
  7. mysql 删除表中 id不等于XXX的 并且XXX字段的重复记录
  8. mysql 内存太大被杀_数据库mysqld进程频繁被杀解决方案[终]
  9. X.509证书代码解析
  10. ASP.NET中的ExecuteNonQuery()方法的用法
  11. 第四次作业——04树
  12. Power BI数据网关
  13. spss入门——简单的数据预处理到时间序列分析系列(五)
  14. gitbub.com设置协作者提交代码步骤
  15. CKA-kubernetes 部署-hard-way-1.1-1.3
  16. 云知声临门一脚不敢踹:科大讯飞指其数据造假,业绩持续增长存疑
  17. 京东云云主机试用体验
  18. 解决魅族17横屏全屏会有白边问题
  19. 利用秀米的SVG布局的穿透功能实现横屏长图互动原理+教程
  20. 本科2019大数据应用大赛 可视化部分

热门文章

  1. 车辆管理系统都有哪些,价格怎么样?
  2. Mac启动nacos2.0.3出错
  3. 鸿蒙系统会和安卓一样垃圾多,“鸿蒙系统”和“安卓系统”到底有什么区别?网友:细节定成败!...
  4. 微信小程序:朋友圈发圈助手文案,头像,壁纸组合
  5. 【页高速缓存】radix tree 源码解析
  6. openj9下载_Eclipse OpenJ9:IBM开源自己的JVM
  7. 分享一套完整的汽车维修订单管理系统源码 带数据库文档
  8. React(5)React兄弟组件之间的通信
  9. Processing实现Google新图标
  10. radiogroup多选_单选按钮和多选按钮