#!/bin/bash set -ex DEBIAN_FRONTEND=noninteractive rstudio-server stop rstudio-launcher stop JSON=$(curl -s https://dailies.rstudio.com/rstudio/latest/index.json) # its bionic for both ubuntu 18 and 20 DIST_JSON=$(echo "${JSON}" | jq .products.workbench.platforms['"'"bionic-amd64"'"']) LATEST_URL=$(echo "${DIST_JSON}" | jq -r '.link') FILENAME=$(echo "${DIST_JSON}" | jq -r '.filename') curl -o /tmp/${FILENAME} ${LATEST_URL} gdebi --non-interactive /tmp/${FILENAME} rm /tmp/${FILENAME} systemctl start rstudio-launcher systemctl start rstudio-server systemctl enable rstudio-launcher systemctl enable rstudio-server