Ubuntu 22.04 (Jammy Jellyfish) 내 RStudio Server 설치

이전에 작성했던 Windows 11 WSL2 이용한 SSH & RStudio Server 설치 및 내·외부에서 접속 글에서 참고한 링크 중 2번 글의 ‘Linux Distribution Setup‘ 내용 중심으로 설치를 진행하면 되나 Ubuntu LTS 버전 중 가장 최신 버전인 22.04 (Jammy Jellyfish) 버전에서 설치를 진행하려면 아래 링크를 병행해서 참고하는 것이 좋다.

물론, 64비트 버전 Ubuntu에만 적용되며 우선 R 설치를 먼저 진행한다.

또한 다음 링크도 감안해서 RStudio Server 설치를 진행한다.

상기 [1] 링크의 내용을 요약하면 아래와 같다. 다만, root 계정이 아닌 일반 계정으로 설치를 전제한다.

터미널에서 아래 명령어들을 차례로 입력해준다.

# update indices
sudo apt update -qq

# install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr

# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc 
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

그리고 이후 다음 명령어들도 입력해서 R 및 의존성 설치5000가지가 넘는 CRAN 패키지들도 설치할 수 있는 사전 준비를 구성한다.

# install R and its dependencies
sudo apt install --no-install-recommends r-base

# add the current R 4.0 or later ‘c2d4u’ repository to get 5000+ CRAN Packages
sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+

이후, 상기 [2] 링크 내용을 참조해서 아래 명령들을 터미널에서 차례로 입력해준다.

  • sudo apt install gdebi-core
  • wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-<버전>-amd64.deb1 ⇒ e.g., wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2023.12.1-402-amd64.deb
  • sudo gdebi rstudio-server-<버전>-amd64.deb ⇒ e.g., sudo gdebi rstudio-server-2023.12.1-402-amd64.deb
  • sudo systemctl enable rstudio-server

여기까지 진행했으면, 마지막으로 다음 명령(들) 입력을 통해서 RStudio Server를 실행한 후 웹에서 접속한다.

  • [Optional] sudo rstudio-server start
  • http://localhost:8787UsernamePasswordUbuntu 계정 UsernamePassword동일!!!

※ 외부에서 접속하고 싶을 경우에는 공유기에서 Port Forwading 설정이 필요하다는 사실은 비밀!

Footnotes

  1. 버전에 해당하는 부분은 [2] 링크를 접속해서 반드시 확인해야한다.

댓글 남기기

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.