1. YUM安装
$ sudo yum install epel-release
$ sudo yum install R
2. 离线安装
$ sudo yum install gcc gcc-gfortran gcc-c++ glibc-headers libreadline6-dev gfortran readline-devel
$ sudo yum install wget libXt-devel fonts-chinese tcl tcl-devel tclx tk tk-devel
$ sudo yum install bzip2-devel mesa-libGLU mesa-libGLU-devel install xz-devel.x86_64 install pcre-devel
$ sudo yum install libcurl libcurl-devel texinfo.x86_64 texlive-pdftex-doc.noarch texlive
$ sudo yum install xorg-x11-server-Xvfb xorg-x11-fonts-75dpi xorg-x11-fonts-100dpi libXtst-devel
$ sudo yum install libssh2-devel libgit2-devel mysql-devel
编译:
$ ./configure --enable-R-shlib=yes --with-tcltk --prefix=/usr/local/R
报错:
configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support
安装 PCRE2,(编译还是有问题):
$ wget -c https://ftp.pcre.org/pub/pcre/pcre2-10.37.zip
$ unzip pcre2-10.37.zip
$ cd pcre2-10.37
$ ./configure --prefix=/usr/local/pcre2 --libdir=/usr/local/lib/pcre --includedir=/usr/local/include/pcre --enable-utf8
$ sudo make
$ sudo make install
# 写入 .zshrc
$ export PATH="/usr/local/pcre2/bin:$PATH"
再次编译,进行安装:
$ ./configure --enable-R-shlib=yes --with-tcltk --prefix=/usr/local/R --with-pcre1
$ sudo make
$ sudo make install
# 写入 .zshrc
$ export PATH="/usr/local/bin:$PATH"