配置本地yum源
[root@localhost /]# cp/mnt/hgfs/D/rhel-server-6.7-x86_64-dvd.iso /
[root@localhost /]# mkdir /mnt/cdrom
[root@localhost /]# vi /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1(这里由0改成1)
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=0(这里由1改成0)
plugins=1
installonly_limit=3
[root@localhost /]# vi /etc/yum.repos.d/R.repo
[Server]
name=rhel6server
baseurl=file:///mnt/cdrom
enable=1
gpgcheck=0
[root@localhost /]# mount -o loop /rhel-server-6.7-x86_64-dvd.iso/mnt/cdrom/
[root@localhost /]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security,subscription-manager
This system is not registered to Red Hat SubscriptionManagement. You can use subscription-manager to register.
Cleaning repos: Server
Cleaning up Everything
[root@localhost /]# yum makecache
Loaded plugins: product-id, refresh-packagekit, security,subscription-manager
This system is not registered to Red Hat SubscriptionManagement. You can use subscription-manager to register.
Server | 4.1 kB 00:00 ...
Server/group_gz |211 kB 00:00 ...
Server/filelists_db | 3.4 MB 00:00 ...
Server/primary_db | 3.1 MB 00:00 ...
Server/other_db |1.3 MB 00:00 ...
Metadata Cache Created
创建安装目录以及补丁包目录
[root@localhost /]# mkdir software
[root@localhost /]# cd software/
[root@localhost software]# mkdir ./packages
[root@localhost software]# mkdir R
[root@localhost software]# ll
total 8
drwxr-xr-x. 2 root root 4096 Nov 25 07:47 packages
drwxr-xr-x. 2 root root 4096 Nov 25 07:48 R
[root@localhost software]# cd R
[root@localhost R]# tar -xzvf /mnt/hgfs/D/R-3.4.2.tar.gz
[root@localhost R]# ll
total 4
drwxr-xr-x. 10 501 games 4096 Sep 28 00:04 R-3.4.2
[root@localhost R]# cd R-3.4.2/
[root@localhost R-3.4.2]# ./configure --enable-R-shlib根据这条编译命令查看报错信息并解决
Yum安装需要的包
[root@localhost R-3.4.2]# yum install gcc-gfortran -y
[root@localhost R-3.4.2]# yum install gcc gcc-c++ -y
[root@localhost R-3.4.2]# yum install readline-devel -y
[root@localhost R-3.4.2]# yum install libXt-devel -y
[root@localhost R-3.4.2]# yum install zlib-devel -y
[root@localhost R-3.4.2]# yum -y install bzip2-devel
[root@localhost R-3.4.2]# yum -y install xz-devel.x86_64
[root@localhost R-3.4.2]# yum install texinfo.x86_64 -y
[root@localhost R-3.4.2]# yum install texlive.x86_64 -y
[root@localhost R-3.4.2]# yum install -yjava-1.8.0-openjdk-devel.x86_64
安装zlib
[root@localhost /]# cd /software/packages/
[root@localhost packages]# tar -xzvf/mnt/hgfs/D/zlib-1.2.8.tar.gz
[root@localhost packages]# cd zlib-1.2.8/
[root@localhost zlib-1.2.8]# ./configure --prefix=/software/packages
[root@localhostzlib-1.2.8]# make && make install
添加环境变量(建议在R目录下添加或直接在profile里面添加)
[root@localhost R-3.4.2]# exportPATH=/software/packages/bin:$PATH
[root@localhost R-3.4.2]# exportLD_LIBRARY_PATH=/software/packages/lib:$LD_LIBRARY_PATH
[root@localhost R-3.4.2]# export CFLAGS="-fPIC-I/software/packages/include"
[root@localhost R-3.4.2]# export LDFLAGS="-fPIC-L/software/packages/lib"
安装bzip2
[root@localhost zlib-1.2.8]# cd /software/packages/
[root@localhost packages]# tar -xzvf /mnt/hgfs/D/bzip2-1.0.6.tar.gz
[root@localhost packages]# cd bzip2-1.0.6/
[root@localhost bzip2-1.0.6]# make CC='gcc -fPIC'
[root@localhost bzip2-1.0.6]# make && make installPREFIX=/software/packages
[root@localhost bzip2-1.0.6]# make -f Makefile-libbz2_so
安装lzma
[root@localhost bzip2-1.0.6]# cd ..
[root@localhostpackages]# tar -xzvf /mnt/hgfs/D/xz-5.2.2.tar.gz
[root@localhost packages]# cd xz-5.2.2/
[root@localhost xz-5.2.2]# ./configure--prefix=/software/packages
[root@localhost xz-5.2.2]# make -j3 && make install
安装pcre
[root@localhost xz-5.2.2]# cd ..
[root@localhost packages]# tar -xzvf/mnt/hgfs/D/pcre-8.38.tar.gz
[root@localhost packages]# cd pcre-8.38/
[root@localhost pcre-8.38]# ./configure--prefix=/software/packages
[root@localhost pcre-8.38]# make -j3 && make install
解决pcre编码不对问题
[root@localhost pcre-8.38]# ./configure --enable-utf8--prefix=/software/packages
[root@localhost pcre-8.38]# make && make install
安装libcurl(支持https版本)
[root@localhost pcre-8.38]# cd ..
[root@localhost packages]# wget --no-check-certificate https://curl.haxx.se/download/curl-7.47.1.tar.gz
[root@localhost packages]# tar -xzvf curl-7.47.1.tar.gz
[root@localhost packages]# cd curl-7.47.1
[root@localhost curl-7.47.1]# ./configure
[root@localhost curl-7.47.1]# make -j3 && makeinstall
至此再执行R的编译能够通过,剩余三个警告缺少插件用6.7yum源安装相应最新版本补丁包但无法解决,应该是版本原因。直接安装不影响使用
[root@localhost R-3.4.2]# make
[root@localhost R-3.4.2]# make install
安装RstudioServer
[root@Rserver Rstudio]# wget https://download2.rstudio.org/rstudio-server-rhel-1.1.383-x86_64.rpm
[root@Rserver Rstudio]# yum install --nogpgcheckrstudio-server-rhel-1.1.383-x86_64.rpm
检查RstudioServer安装状态
[root@Rserver Rstudio]# rstudio-server verify-installation
rstudio-server stop/waiting
rstudio-server start/running, process 89103
Rstudio Server hub访问
http://<server-ip>:8787