Skip to content

Instantly share code, notes, and snippets.

@aboutaaron
Last active August 1, 2019 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aboutaaron/6933b9ba0d742167c61ca50cbee114d3 to your computer and use it in GitHub Desktop.
Save aboutaaron/6933b9ba0d742167c61ca50cbee114d3 to your computer and use it in GitHub Desktop.
Helpful docs for working with Littlest Jupyter Hub

How to install R on Jupyter Hub

Open Terminal from the Jupyter Hub instance and then type the following:

sudo -E conda install r-base r-essentials r-irkernel 
sudo chown -R `whoami` /opt/tljh/user/lib/R

Uninstalling and removing The Littlest Jupyter Hub from a server

These instructions assume you're using the default tljh install locations and are using the super user. If you're not, add sudo in front of all these commands.

Removing TLJH

  1. Stop the systemd services associated with Jupyter Hub using systemctl
systemctl  # find all services. You can optionally add the --all flag to check for services that may have stopped
  1. You'll need to stop two main services: traefik.service and jupyter.service. You'll also need to remove any services associated with a user. These are usually named jupyter-[USER].service where [USER] is the user login name.

Once you're done stopping the daemons, you'll need to remove them from /etc/systemd/system/.

Run the following commands for each service. For this example, we'll stop and remove traefik:

systemctl stop traefik.service
systemctl disable traefik.service
rm /etc/systemd/system/traefik.service

Do this for traefik, jupyter and any associated users. Once this is done reset and reload the daemons:

systemctl daemon-reload
systemctl reset-failed
systemctl # optional call to ensure services have been removed
  1. Remove all associated users created by tljh. Names should be jupyter-[USER] where [USER] is the login username:
userdel -r jupyter-[USER]  # the -r flag will also remove the users directories in /home

If you don't remember the users you created, you can get a list of all jupyter users with the following command:

cat /etc/passwd | grep jupyter
  1. Lastly, you'll need to remove the tljh code and binary:
rm -rf /opt/tljh/
rm /usr/bin/tljh-config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment