diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index 87846d1..0e9ba81 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -132,7 +132,6 @@ progress_page_html = """ logger = logging.getLogger(__name__) - # This function is needed both by the process starting this script, and by the # TLJH installer that this script execs in the end. Make sure its replica at # tljh/utils.py stays in sync with this version! @@ -200,15 +199,18 @@ def ensure_host_system_can_install_tljh(): .strip() ) - # Require Ubuntu 18.04+ + # Require Ubuntu 18.04+ or Debian 10+ distro = get_os_release_variable("ID") version = float(get_os_release_variable("VERSION_ID")) - if distro != "ubuntu": - print("The Littlest JupyterHub currently supports Ubuntu Linux only") + if distro not in ["ubuntu", "debian"]: + print("The Littlest JupyterHub currently supports Ubuntu or Debian Linux only") sys.exit(1) - elif float(version) < 18.04: + elif distro == "ubuntu" and float(version) < 18.04: print("The Littlest JupyterHub requires Ubuntu 18.04 or higher") sys.exit(1) + elif distro == "debian" and float(version) < 10: + print("The Littlest JupyterHub requires Debian 10 or higher") + sys.exit(1) # Require Python 3.6+ if sys.version_info < (3, 6): @@ -228,6 +230,7 @@ def ensure_host_system_can_install_tljh(): "For local development, see http://tljh.jupyter.org/en/latest/contributing/dev-setup.html" ) sys.exit(1) + return distro, version class ProgressPageRequestHandler(SimpleHTTPRequestHandler): @@ -330,7 +333,7 @@ def main(): start a local webserver temporarily and report its installation progress via a web site served locally on port 80. """ - ensure_host_system_can_install_tljh() + distro, version = ensure_host_system_can_install_tljh() parser = ArgumentParser() parser.add_argument("--show-progress-page", action="store_true") @@ -425,7 +428,9 @@ def main(): ["apt-get", "install", "--yes", "software-properties-common"], env=apt_get_adjusted_env, ) - run_subprocess(["add-apt-repository", "universe", "--yes"]) + # Section "universe" exists and is required only in ubuntu. + if distro == "ubuntu": + run_subprocess(["add-apt-repository", "universe", "--yes"]) run_subprocess(["apt-get", "update"]) run_subprocess( [ @@ -436,6 +441,7 @@ def main(): "python3-venv", "python3-pip", "git", + "sudo", # sudo is missing in default debian install ], env=apt_get_adjusted_env, )