From 3cbac01c59535cafe1ad9a51329a053a9d32b2ba Mon Sep 17 00:00:00 2001 From: RomanNum3ral Date: Tue, 30 Sep 2025 15:46:45 +0000 Subject: [PATCH] Update install_v2.sh --- install_v2.sh | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/install_v2.sh b/install_v2.sh index 8f077e8..426610a 100644 --- a/install_v2.sh +++ b/install_v2.sh @@ -1,27 +1,38 @@ #!/bin/bash set -euo pipefail -# --- Update & Upgrade machine --- +# --- Update & Upgrade --- apt update apt upgrade -y -# --- Install prerequisites --- -apt install -y python3 python3-dev git curl gdebi-core \ - software-properties-common dirmngr gnupg apt-transport-https \ +# --- Prereqs --- +apt install -y python3 python3-dev git curl \ + gdebi-core software-properties-common dirmngr gnupg apt-transport-https \ libssl-dev libcurl4-openssl-dev libxml2-dev -# --- Install R (from Ubuntu repos, CRAN packages available) --- +# --- R (Ubuntu repo or switch to CRAN later if you want newer) --- apt install -y r-base -# --- Install RStudio Server (Jammy build works on Noble) --- -RSTUDIO_DEB="rstudio-server-latest-amd64.deb" -curl -LO https://download2.rstudio.org/server/jammy/amd64/${RSTUDIO_DEB} -gdebi -n ${RSTUDIO_DEB} -rm -f ${RSTUDIO_DEB} +# --- RStudio Server (Jammy build works on Noble) --- +ARCH=amd64 +DIST=jammy +VER=2025.09.0-387 +BASE_URL="https://download2.rstudio.org/server/${DIST}/${ARCH}" +DEB="rstudio-server-${VER}-${ARCH}.deb" -# --- Install JupyterHub (The Littlest JupyterHub) --- +curl -fL -o "${DEB}" "${BASE_URL}/${DEB}" + +# sanity check: fail if the downloaded file is suspiciously small (<50MB) +[ $(stat -c%s "${DEB}") -gt $((50*1024*1024)) ] || { echo "Download looks wrong (file too small)"; exit 1; } + +gdebi -n "${DEB}" +rm -f "${DEB}" + +# --- The Littlest JupyterHub --- curl -L https://tljh.jupyter.org/bootstrap.py | sudo -E python3 - --admin anon -# --- Add R kernel to Jupyter --- -R -e "install.packages('IRkernel', repos='http://cran.r-project.org')" +# --- Add R to Jupyter (IRkernel) --- +R -e "install.packages('IRkernel', repos='https://cloud.r-project.org')" R -e "IRkernel::installspec(user = FALSE)" + +echo "Done. RStudio Server: http://:8787 (login with a system user)"