在生产环节,一般是不联网的,下面介绍在无望环境如何安装R及R-studio

1.  安装CentOS for R语言的基础环境

1.1 libpng,X11,libjpeg等支持

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gd gd2 gd-devel gd2-devel perl-CPAN pcre-devel

1.2 gcc编译环境支持

yum install gcc-gfortran

yum install gcc gcc-c++ 

yum install readline-devel 

yum install libXt-devel

1.3 vnc-server,openssl,xhost+

yum install openssl

yum -y install vnc vnc-server

yum -y install tigervnc-server

PS:vnc-server常用命令

service vncserver start

service vncserver stop

vncserver -kill :10

vi /etc/sysconfig/vncservers

VNCSERVERS="5:hive"

VNCSERVERARGS[5]="-geometry 800x600”

export DISPLAY=:0

xhost +

ps -ef |grep vnc

ps -aux |grep vnc

2.  编译安装R语言的基础环境

在R官网(尽量选择国内镜像)下载你所需要R语言版本,我下载的是R-3.2.2

https://mirrors.tuna.tsinghua.edu.cn/CRAN/

wget https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/base/R-3/R-3.2.3.tar.gz

tar -zxvf R-3.2.3.tar.gz

./configure --enable-R-shlib--with-libpng --with-jpeglib --with-libtiff --with-x
make clean
make
make install

3. 安装Rstudio Server

wget https://download2.rstudio.org/rstudio-server-rhel-1.0.136-x86_64.rpm
yum install --nogpgcheck rstudio-server-rhel-1.0.136-x86_64.rpm

关闭服务器的防火墙,或者打开8787端口

登录http://ip地址:8787

输入capabilities()

显示如下代表正常,这里面jpeg png X11支持(TRUE代表支持),是在线进行R画图的重要驱动,如果显示False则不能够在Rstudio-Server中画图,那样我们搭建Rstudio Server就没有意义了

> capabilities()
jpeg png tiff tcltk X11 aqua http/ftp
TRUE TRUE FALSE FALSE TRUE FALSE TRUE
sockets libxml fifo cledit iconv NLS profmem
TRUE TRUE TRUE TRUE TRUE TRUE FALSE
cairo ICU long.double libcurl
FALSE FALSE TRUE FALSE
常见错误错误会显示如下
> capabilities()
  no protocol specified
jpeg png tiff tcltk X11 aqua http/ftp
FALSE    FALSE    FALSE     FALSE FALSE FALSE TRUE
    sockets   libxml     fifo    cledit     iconv     NLS   profmem
    TRUE     TRUE      TRUE     TRUE     TRUE     TRUE    FALSE
    cairo     ICU     long.double  libcurl
    FALSE     FALSE     TRUE     FALSE
上述是由于没有开放X环境权限,所有的解决方案只要按照这个方向就能找到,我的最终生效的调试步骤如下:

4. 调试过程

[root@bonnie1 ~]# xdpyinfo

xdpyinfo:  unable to open display "bonnie1:1".

[root@bonnie1 ~]# export DISPLAY=:0

[root@bonnie1 ~]# xdpyinfo

name of display:    :0

version number:    11.0

vendor string:    Red Hat, Inc.

vendor release number:    11300000

maximum request size:  16777212 byte

motion buffer size:  256

bitmap unit, bit order, padding:    32, LSBFirst, 32

image byte order:    LSBFirst

number of supported pixmap formats:    7

supported pixmap formats:

depth 1, bits_per_pixel 1, scanline_pad 32

depth 4, bits_per_pixel 8, scanline_pad 32

depth 8, bits_per_pixel 8, scanline_pad 32

depth 15, bits_per_pixel 16, scanline_pad 32

depth 16, bits_per_pixel 16, scanline_pad 32

depth 24, bits_per_pixel 32, scanline_pad 32

… …

[root@bonnie1 ~]# xhost +

access control disabled, clients can connect from any host

[root@bonnie1 ~]# su - hive

[hive@bonnie1 ~]$ xhost +

access control disabled, clients can connect from any host

[root@bonnie1 ~]# ps -ef |grep vnc

hive      1951     1  0 14:41 pts/0    00:00:00 /usr/bin/Xvnc :1 -desktop bonnie1:1 (hive) -auth /home/hive/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/hive/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn

hive      1957  1956  0 14:41 pts/0    00:00:00 vncconfig -iconic

root     23069  2339  0 18:14 pts/0    00:00:00 grep vnc

[root@bonnie1 ~]# ps -aux |grep vnc

Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ

hive      1951  0.0  2.9 129648 30100 pts/0    S    14:41   0:00 /usr/bin/Xvnc :1 -desktop bonnie1:1 (hive) -auth /home/hive/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/hive/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn

hive      1957  0.0  0.2  50152  2092 pts/0    S    14:41   0:00 vncconfig -iconic

root     23071  0.0  0.0 103264   840 pts/0    S+   18:14   0:00 grep v

[hive@bonnie1 ~]$ ps -ef |grep vnc

hive      1951     1  0 14:41 pts/0    00:00:00 /usr/bin/Xvnc :1 -desktop bonnie1:1 (hive) -auth /home/hive/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/hive/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn

hive      1957  1956  0 14:41 pts/0    00:00:00 vncconfig -iconic

hive     23063 23032  0 18:13 pts/0    00:00:00 grep vnc

CentOS 6.5 无网环境安装R及Rstudio的方法的方法的更多相关文章

  1. 无网环境安装docker之--rpm

    总体思路:找一台可以联网的linux,下载docker的RPM依赖包而不进行安装(yum localinstall),将所有依赖的rpm环境打包好,再在无网环境中解压逐一安装(rpm:  --forc ...

  2. R语言入门1:安装R和RStudio

    R语言入门1:安装R和RStudio 曹务强 中科院遗传学博士研究生 9 人赞同了该文章 1. Windows安装R 在Windows系统上,安装R语言比较简单,直接从R的官方网站下载,按照正常的软件 ...

  3. Ubuntu Server安装R和Rstudio(zz)

    Ubuntu Server安装R和Rstudio 发表于 技术天堂 2014-03-15 21:03 字数: 534 阅读量: 205 R是一个在科研领域很常用的工具,经常用R的年轻人或者经常上统计之 ...

  4. 安装R和Rstudio

    安装R和Rstudio 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.  一.安装R编程语言 1.登录下载网站 https://cran.r-project.org/ 2.点击下载链 ...

  5. Ubuntu 16.04 安装R和RStudio

    在Ubuntu上安装R和Rstudio的时候碰到了一些依赖项不存在的错误 The following packages have unmet dependencies: r-base-core : D ...

  6. Centos7.2内网环境安装MySQL5.7.24

    1.配置本地yum源 内网环境,首先需要配置本地yum源,以解决MySQL的依赖安装,具体参考该文:点击打开 2.查看服务器环境 uname -a 3.去官网下载MySQL安装包 MySQL官网网址: ...

  7. Linux系统如何在离线环境或内网环境安装部署Docker服务和其他服务

    如何在离线环境或纯内网环境的Linux机器上安装部署Docker服务或其他服务.本次我们以Docker服务和Ansible服务为例. 获取指定服务的所有rpm包 保证要获取rpm包的机器能够上网. 本 ...

  8. Linux系统之路——如何在CentOS7.2安装R和RStudio(Server)

    使用ubuntu的小伙伴们直接使用命令sudo apt-get install r-base-dev或者r-base搞定.然而对于使用centos的我却一直卡在安装这一步,十分的悲催,只有羡慕的份,但 ...

  9. centos7 安装R和Rstudio客户端

    #官网下载R和Rstudio 我下载的是 R-3.2.1.tar.gz和rstudio-0.99.467-x86_64.rpm两个版本 rstudio没有看见有centos版的,下的这个RStudio ...

随机推荐

  1. css基本知识框架(转)

    css基本知识框架: 1.css样式表的基本概念 2.样式表基本类型-----1.内嵌样式 2.内联样式3.链入外部样式表4.导入外部?式 3.样式表配置方法 4.字体属性----1.font-fam ...

  2. 2016中国大学生程序设计竞赛(长春)-重现赛 1010Ugly Problem 回文数 模拟

    Ugly Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tota ...

  3. equals(==),toString

    equals/==: 只有指向同一个对象是,才返回true. 特殊: String s1 = new String("hello"); String s2 = new String ...

  4. ue4 build configuration的解释

    ue4的build系统,继承并发展了3代的一如既往的复杂.. 一.每个configuration由两部份组成:[(性能)模式]+[(内容)组成] 模式有:Debug,DebugGame,Develop ...

  5. AutoResetEvent信号锁 waitone set 执行一次线程退出 挺不爽的地方

    下边有个 循环调用线程写奇偶数的程序 class TheadTest { //定义一个Stream对象接收打开文件 private FileStream st; //构造方法 public Thead ...

  6. [vb.net]XML File Parsing in VB.NET

    Introduction Parsing XML files has always been time consuming and sometimes tricky. .NET framework p ...

  7. Redis 集群方案- 主从切换测试

    大约一年多前,公司同事开始使用Redis,不清楚是配置,还是版本的问题,当时的Redis经常在使用一段时间后,连接爆满且不释放.印象中,Redis 2.4.8以下的版本由于设计上的主从库同步问题,就会 ...

  8. MongoDB介绍与windows下安装

    MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的.他支持的数据结构非常松散,是类 似json的bjson格式,因此可以存储比较复杂的数据类型. ...

  9. Linux更改服务器Hostname

    在我们需要维护较多的服务器时,有意义的Hostname将时刻提醒我们这台服务器的功能. ****** 1.Debian echo '127.0.1.1 git-server' >> /et ...

  10. Linq to sql 语法方法示例

    联表查询,判断追加条件,对集合分页 ) { var data = from m in _db.AppArticleComment join o in _db.AppArticle on m.Artic ...