ubuntu18.04 에 R 4.0 설치 및 Rstudio Server 설치하기

2020. 4. 29. 20:03꿀팁 분석 환경 설정/Linux 관련 팁

광고 한 번씩 눌러주세요! 블로그 운영에 큰 힘이 됩니다 :)

 

도커를 이용해서 ubuntu 18.04 컨테이너 만들기

docker run --ip ##### --rm -p 8886:8886 -it ubuntu /bin/bash
apt-get update
apt-get install sudo wget vim net-tools
sudo apt-get install gnupg gnupg2 gnupg1

 

 

18.04 이므로 bionic-40을 해야 한다.

 

R 4.0 설치하기

vi /etc/apt/sources.list

## 추가하기
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/
## 저장후 vi 닫기
## update 해서 sources.list 반영하기
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
## 설치하기
sudo apt-get install r-base

 

(현재 설치는 되지만 Docker에서 Rstudio Server 포트 접속이 안되니 R 4.0설치만 참고하길 바람)

 

Rstudio Server 설치하기

sudo apt-get install gdebi-core libssl1.0.0 libssl-dev
## 현재 4월 29일 기준 최신 버전
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.2.5042-amd64.deb
sudo gdebi rstudio-server-1.2.5042-amd64.deb
rstudio-server verify-installation

만약 Rstudio가 안열리면, docker를 일단 현재 버전까지 docker를 commit하고 새로 만든 docker id로 run하면 된다 물론 포트는 8886을 열어줘야 한다.

docker commit [image id] [new_docker_name]/[new_docker_name]:[tag]
ex) docker commit 1e13123123 rstudio/rstudio:1.0
docker run -p 8886:8886 -it rstudio/rstudio:1.0 /bin/bash
/usr/lib/rstudio-server/bin/rserver --server-daemonize=0 --www-port 8886

 

 

https://rstudio.com/products/rstudio/download-server/debian-ubuntu/

 

Download RStudio Server for Debian & Ubuntu

Download RStudio Server for Debian & Ubuntu Prerequisites RStudio Server requires Debian version 8 (or higher) or Ubuntu version 12.04 (or higher). Installing R RStudio requires a previous installation of R version 3.0.1 or higher. To install the latest ve

rstudio.com

https://stackoverflow.com/questions/20336644/completely-uninstall-r-linux

 

completely uninstall r linux

I am trying to update my version of R on linux mint, however broken dependencies are stopping me doing this. after trying everything such as adding repos from Cran, sudo apt-get update, I still can...

stackoverflow.com

https://stackoverflow.com/questions/10476713/how-to-upgrade-r-in-ubuntu

 

How to upgrade R in ubuntu?

I have R 2.12.1 installed in my ubuntu, and I'd like upgrade to lastest version 2.15, how can achieve that ? Thanks

stackoverflow.com

https://github.com/lazariv/easybuild-easyconfigs/tree/master/rstudio

 

lazariv/easybuild-easyconfigs

Collection of useful easyconfig files. Contribute to lazariv/easybuild-easyconfigs development by creating an account on GitHub.

github.com

 

728x90