Skip to content

Commit

Permalink
support installing RStudio Server for Ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed Apr 29, 2022
1 parent 0e92c91 commit 0bcb2ca
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/install_rstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RSTUDIO_VERSION=${1:-${RSTUDIO_VERSION:-"stable"}}
DEFAULT_USER=${DEFAULT_USER:-"rstudio"}

ARCH=$(dpkg --print-architecture)
UBUNTU_VERSION=$(lsb_release -sc)

apt-get update
apt-get install -y --no-install-recommends \
Expand All @@ -31,8 +32,6 @@ apt-get install -y --no-install-recommends \
sudo \
wget

rm -rf /var/lib/apt/lists/*

# install s6 supervisor
/rocker_scripts/install_s6init.sh

Expand All @@ -43,11 +42,15 @@ if [ "$RSTUDIO_VERSION" = "latest" ]; then
RSTUDIO_VERSION="stable"
fi

if [ "$UBUNTU_VERSION" = "focal" ]; then
UBUNTU_VERSION="bionic"
fi

if [ "$RSTUDIO_VERSION" = "stable" ] || [ "$RSTUDIO_VERSION" = "preview" ] || [ "$RSTUDIO_VERSION" = "daily" ]; then
wget "https://rstudio.org/download/latest/${RSTUDIO_VERSION}/server/bionic/rstudio-server-latest-${ARCH}.deb" -O "$DOWNLOAD_FILE"
wget "https://rstudio.org/download/latest/${RSTUDIO_VERSION}/server/${UBUNTU_VERSION}/rstudio-server-latest-${ARCH}.deb" -O "$DOWNLOAD_FILE"
else
wget "https://download2.rstudio.org/server/bionic/${ARCH}/rstudio-server-${RSTUDIO_VERSION/"+"/"-"}-${ARCH}.deb" -O "$DOWNLOAD_FILE" ||
wget "https://s3.amazonaws.com/rstudio-ide-build/server/bionic/${ARCH}/rstudio-server-${RSTUDIO_VERSION/"+"/"-"}-${ARCH}.deb" -O "$DOWNLOAD_FILE"
wget "https://download2.rstudio.org/server/${UBUNTU_VERSION}/${ARCH}/rstudio-server-${RSTUDIO_VERSION/"+"/"-"}-${ARCH}.deb" -O "$DOWNLOAD_FILE" ||
wget "https://s3.amazonaws.com/rstudio-ide-build/server/${UBUNTU_VERSION}/${ARCH}/rstudio-server-${RSTUDIO_VERSION/"+"/"-"}-${ARCH}.deb" -O "$DOWNLOAD_FILE"
fi

dpkg -i "$DOWNLOAD_FILE"
Expand Down Expand Up @@ -109,6 +112,9 @@ cp /rocker_scripts/init_set_env.sh /etc/cont-init.d/01_set_env
cp /rocker_scripts/init_userconf.sh /etc/cont-init.d/02_userconf
cp /rocker_scripts/pam-helper.sh /usr/lib/rstudio-server/bin/pam-helper

# Clean up
rm -rf /var/lib/apt/lists/*

# Check the RStudio Server version
echo -e "Check the RStudio Server version...\n"

Expand Down

0 comments on commit 0bcb2ca

Please sign in to comment.