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

R语言官网:https://www.r-project.org/
选择镜像:China; 中科院; https://mirrors.ustc.edu.cn/CRAN/
右键复制地址 R-4.1.2.tar.gz

1、下载

wget https://mirrors.ustc.edu.cn/CRAN/src/base/R-4/R-4.1.2.tar.gz

2、解压

tar zxvf ./R-4.1.2.tar.gz

3、在解压的文件夹中查看configure 帮助文档

./configure --help  #查看帮助

我们发现其默认安装在/usr/local/bin或/usr/local,我们可以通过"--prefix=(绝对目录)"更改

4、通过configure检查安装环境

./configure --prefix=/home/bin  #将R语言的快捷键放在bin目录下

这时会出现大量的报错:
首先对于新处理器来说我们要配置基本的所需:

1、gcc 
yum -y install gcc和yum -y install gcc-c++
2、xz
下载解压
wget https://tukaani.org/xz/xz-5.2.5.tar.gz解压tar -zxvf xz-5.2.5.tar.gz
配置安装
./configure --prefix=存放位置自定义
make
sudo make install
3、pcre2
下载解压
wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
tar -zxvf pcre-8.45.tar.gz
配置安装
./configure
make && make install
查看安装版本
pcre-config --version

或直接输入这一套命令配置环境

yum install -y --skip-broken zlib java gcc-gfortran gcc gcc-c++ readline-devel libXt-devel bzip2-devel.x86_64 bzip2-libs.x86_64 xz-devel.x86_64 pcre-devel.x86_64 libcurl-devel.x86_64
报错1:--with-readline=yes (default) and headers/libs are not available
yum install readline-devel
报错2: --with-x=yes (default) and X11 headers/libs are not available
yum install libXt-devel
报错3:Checking for curl-config... no

checking curl/curl.h usability... no
checking curl/curl.h presence... no
checking for curl/curl.h... no
configure: error: libcurl >= 7.28.0 library and headers are required with support for https

下载
https://curl.haxx.se/download/curl-7.47.1.tar.gz
./configure --prefix=/software/packages
make -j3
make install
报错4:Checking if libcurl is version 7 and >= 7.28.0... yes

checking if libcurl supports https... no
configure: error: libcurl >= 7.28.0 library and headers are required with support for https

下载
openssl-1.0.1u.tar.gz
tar -xzvf openssl-1.0.1u.tar.gz
cd openssl-1.0.1u
./config -fPIC --prefix=/usr/local/openssl enable-shared
./config -t
make && make install
设置环境变量
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin 
重新安装curl:指定openssl
./configure --prefix=/software/packages --with-openssl-include=/usr/local/openssl/include/ --with-openssl-lib=/usr/local/openssl/lib
make -j3
make install
报错5:ERROR: cannot verify pkg.jenkins.io's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3

Issued certificate has expired. To connect to pkg.jenkins.io insecurely, use `--no-check-certificate'

yum install -y ca-certificates
报错6:WARNING: neither inconsolata.sty nor zi4.sty found: PDF vignettes and package manuals will not be rendered optimally
一步一步来
wget http://mirrors.ctan.org/fonts/inconsolata.zip
进入文件夹后解压
unzip inconsolata.zip
cp -Rfp inconsolata/* /usr/share/texmf/
mktexlsr

5、安装,大约需要10分钟

make
make install 

6、运行
在自己安装的快捷方式的目录下编辑

./R  #回车
q()  #退出
终于成功了.png

你可能感兴趣的:(全网最全:新处理器安装R所出现的报错问题)