1. YUM安装

  1. $ sudo yum install epel-release
  2. $ sudo yum install R

2. 离线安装

  1. $ sudo yum install gcc gcc-gfortran gcc-c++ glibc-headers libreadline6-dev gfortran readline-devel
  2. $ sudo yum install wget libXt-devel fonts-chinese tcl tcl-devel tclx tk tk-devel
  3. $ sudo yum install bzip2-devel mesa-libGLU mesa-libGLU-devel install xz-devel.x86_64 install pcre-devel
  4. $ sudo yum install libcurl libcurl-devel texinfo.x86_64 texlive-pdftex-doc.noarch texlive
  5. $ sudo yum install xorg-x11-server-Xvfb xorg-x11-fonts-75dpi xorg-x11-fonts-100dpi libXtst-devel
  6. $ sudo yum install libssh2-devel libgit2-devel mysql-devel

编译:

  1. $ ./configure --enable-R-shlib=yes --with-tcltk --prefix=/usr/local/R

报错:

  1. configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support

安装 PCRE2,(编译还是有问题):

  1. $ wget -c https://ftp.pcre.org/pub/pcre/pcre2-10.37.zip
  2. $ unzip pcre2-10.37.zip
  3. $ cd pcre2-10.37
  4. $ ./configure --prefix=/usr/local/pcre2 --libdir=/usr/local/lib/pcre --includedir=/usr/local/include/pcre --enable-utf8
  5. $ sudo make
  6. $ sudo make install
  7. # 写入 .zshrc
  8. $ export PATH="/usr/local/pcre2/bin:$PATH"

再次编译,进行安装:

  1. $ ./configure --enable-R-shlib=yes --with-tcltk --prefix=/usr/local/R --with-pcre1
  2. $ sudo make
  3. $ sudo make install
  4. # 写入 .zshrc
  5. $ export PATH="/usr/local/bin:$PATH"