centos6/redhat6离线rpm包安装R3.4.3

#!/bin/sh

#ATOM_HOME='/root/Desktop/atom7.2'

if [! -x "$ATOM_HOME" ]; then

  echo "The environment variable of ATOM_HOME need to be set first."

else

  if [ -x "/etc/yum.repos.d" ]; then

    if [ ! -x "/etc/yum.repos.d.old" ]; then

      cp -rf /etc/yum.repos.d /etc/yum.repos.d.old

    fi

    rm -rf /etc/yum.repos.d/*

    if [ -f "$ATOM_HOME/Env/OSRepo.tar.gz" ]; then

  echo "Mount the OS-yum in your linux syterm."

      cd $ATOM_HOME/Env

      tar -zxvf $ATOM_HOME/Env/OSRepo.tar.gz

      echo -e "[OS]\nname=OS\nbaseurl=file://$ATOM_HOME/Env/OSRepo\nenabled=1\ngpgcheck=0" >> /etc/yum.repos.d/R.repo 

    fi

    if [ -f "$ATOM_HOME/Env/RRepo.tar.gz" ]; then

  echo "Mount the R-yum in your linux syterm."

      cd $ATOM_HOME/Env 

      tar -zxvf $ATOM_HOME/Env/RRepo.tar.gz

      echo -e "[R]\nname=R\nbaseurl=file://$ATOM_HOME/Env/RRepo\nenabled=1\ngpgcheck=0" >> /etc/yum.repos.d/R.repo 

    fi

    yum clean all

    yum makecache

    yum -y install R

    if [ -x "/etc/yum.repos.d.old" ]; then

  echo "Unmount the OS-yum and R-yum from your linux syterm."

      cp -rf /etc/yum.repos.d.old /etc

    fi

  fi

  if [ -x "/usr/lib64/R" ]; then

    cd $ATOM_HOME/Env

    if [ -f "$ATOM_HOME/Env/Rlib.tar.gz" ]; then 

      tar -zxvf $ATOM_HOME/Env/Rlib.tar.gz

    fi

    if [ ! -x "/usr/lib64/R/library.old" ]; then

      cp -rf /usr/lib64/R/library /usr/lib64/R/library.old

    fi

echo "Copy the R-library in your R home."

    cp -ri -n $ATOM_HOME/Env/library/* /usr/lib64/R/library/

  fi

  chmod 700 $ATOM_HOME/Atom

  echo "ATOM for test with the functions : Explore, Learn, Act, Test."

  $ATOM_HOME/Atom Explore -conf $ATOM_HOME/conf/atom_explore.json

  $ATOM_HOME/Atom Learn -conf $ATOM_HOME/conf/atom_learn.json

  $ATOM_HOME/Atom Act -conf $ATOM_HOME/conf/atom_act.json

  $ATOM_HOME/Atom Test -conf $ATOM_HOME/conf/atom_test.json

  #$ATOM_HOME/Atom Go -conf $ATOM_HOME/conf/atom_go.json

  echo "ATOM INSTALL : SUCCESS."

fi

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容