Linux-Rstudio安装

1、安装下载R

wget https://cran.r-project.org/src/base/R-4/R-4.1.0.tar.gz

2、解压在/usr/local下

tar -zxvf R-4.1.0.tar.gz

3、正式安装R之前,需要安装各种依赖包

yum -y install bzip2-devel
yum -y install xz-devel.x86_64
yum install readline-devel
yum install gcc-gfortran
yum -y install bzip2-devel
yum install glibc-headers
yum -y install gcc
yum install gcc-c++
yum install libXt-devel
yum install -y gcc
yum install -y glibc-headers
yum install -y libreadline6-dev gfortran
yum install -y readline-devel
yum install -y wget libXt-devel
yum install -y fonts-chinese tcl tcl-devel tclx tk tk-devel
yum install -y mesa-libGLU mesa-libGLU-devel
yum install -y install bzip2-devel
yum install -y install xz-devel.x86_64
yum install -y install pcre-devel
yum install -y install libcurl
yum install -y install libcurl-devel
yum install -y  texinfo.x86_64
yum install -y texlive-pdftex-doc.noarch
yum install -y texlive
yum install java.1.8.0-openjdk-*

4、创建编译的文件夹目录R

mkdir /usr/local/R

5、进入R安装包并进行环境编译

cd /usr/local/R4.1.0

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

6、开始安装

make & make insttall

7、安装完成后,打开/etc/profile,并在最后一行添加环境参数

vi /etc/profile

----------------

R_HOME=/usr/local/R

PATH=$PATH:$R_HOME/bin

 8、安装配置完成后可以测试R

[root@centos]#R

 9、下载Rstudio

wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.2.5033-x86_64.rpm

10、安装Rstudio

yum install -y rstudio-server-rhel-1.2.5033-x86_64.rpm

11、安装完成后需要开启8787端口

systemctl enable rstudio-server.service
systemctl start rstudio-server.service
systemctl status rstudio-server
firewalld
firewall-cmd --permanent --add-port=8787/tcp
firewall-cmd --permanent --add-port=8787/udp
firewall-cmd --reload
12、设置完成后,重启Rstudio

rstudio-server restart

(没有任何消息表示安装完成)

如果有提示,可以使用rstudio-server verify-installation查看问题

13、完成后,使用浏览器访问测试

http://ip:8787

 -----------------------------------------------------------------------------

安装过程的问题:

1、报错:configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support
需要使用下面命令
yum install pcre2*

2、报错:configure: 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
    前提安装zip/unzip
    yum install zip
    yum install unzip

迁移解压好的inconsolata
cp -Rfp inconsolata/* /usr/share/texmf
刷新sty
mktexlsr

posted @ 2021-08-30 14:43  kamizama  阅读(2708)  评论(0编辑  收藏  举报