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 a444893
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/install_rstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ARCH=$(dpkg --print-architecture)

apt-get update
apt-get install -y --no-install-recommends \
lsb_release \
file \
git \
libapparmor1 \
Expand All @@ -31,7 +32,7 @@ apt-get install -y --no-install-recommends \
sudo \
wget

rm -rf /var/lib/apt/lists/*
UBUNTU_VERSION=$(lsb_release -sc)

# install s6 supervisor
/rocker_scripts/install_s6init.sh
Expand All @@ -43,11 +44,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 +114,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 a444893

Please sign in to comment.