之前的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 transaction
Installing : 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