From 395cb93290dc47e9a899e3d936cb94ad80d6953d Mon Sep 17 00:00:00 2001 From: owah <4345945+owah@users.noreply.github.com> Date: Wed, 28 Nov 2018 12:43:12 +0100 Subject: [PATCH 1/3] Adds the universe repository to the used sources This change is required, to support Ubuntu Server 18.04.01, which by default doesn't ship with universe. Universe contains python3-venv which is needed for tljh --- bootstrap/bootstrap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index 3a42fb2..bf65a27 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -66,6 +66,7 @@ def main(): else: logger.info('Setting up hub environment') initial_setup = True + subprocess.check_output(['add-apt-repository', 'universe'], stderr=subprocess.STDOUT) subprocess.check_output(['apt-get', 'update', '--yes'], stderr=subprocess.STDOUT) subprocess.check_output(['apt-get', 'install', '--yes', 'python3', 'python3-venv', 'git'], stderr=subprocess.STDOUT) logger.info('Installed python & virtual environment') From 948548b033e7425db836530273aed3d4f060b9e5 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Sun, 19 May 2019 20:36:10 -0700 Subject: [PATCH 2/3] bootstrap: Install software-properties-common Gets us add-apt-repository, which helps ensure the universe repository is enabled. --- bootstrap/bootstrap.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index bf65a27..03336e0 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -66,6 +66,13 @@ def main(): else: logger.info('Setting up hub environment') initial_setup = True + # Install software-properties-common, so we can get add-apt-repository + # That helps us make sure the universe repository is enabled, since + # that's where the python3-pip package lives. In some very minimal base + # VM images, it looks like the universe repository is disabled by default, + # causing bootstrapping to fail. + subprocess.check_output(['apt-get', 'update', '--yes'], stderr=subprocess.STDOUT) + subprocess.check_output(['apt-get', 'install', '--yes', 'software-properties-common'], stderr=subprocess.STDOUT) subprocess.check_output(['add-apt-repository', 'universe'], stderr=subprocess.STDOUT) subprocess.check_output(['apt-get', 'update', '--yes'], stderr=subprocess.STDOUT) subprocess.check_output(['apt-get', 'install', '--yes', 'python3', 'python3-venv', 'git'], stderr=subprocess.STDOUT) From a8b28744a62561897d032ba803b236f45ee2b505 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Sun, 19 May 2019 20:36:55 -0700 Subject: [PATCH 3/3] bootstrap: Explicitly mark python3-pip as installed We need it to work, so we mark it as an explicit dependency. --- bootstrap/bootstrap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index 03336e0..629d8cc 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -74,8 +74,14 @@ def main(): subprocess.check_output(['apt-get', 'update', '--yes'], stderr=subprocess.STDOUT) subprocess.check_output(['apt-get', 'install', '--yes', 'software-properties-common'], stderr=subprocess.STDOUT) subprocess.check_output(['add-apt-repository', 'universe'], stderr=subprocess.STDOUT) + subprocess.check_output(['apt-get', 'update', '--yes'], stderr=subprocess.STDOUT) - subprocess.check_output(['apt-get', 'install', '--yes', 'python3', 'python3-venv', 'git'], stderr=subprocess.STDOUT) + subprocess.check_output(['apt-get', 'install', '--yes', + 'git', + 'python3', + 'python3-venv', + 'python3-pip' + ], stderr=subprocess.STDOUT) logger.info('Installed python & virtual environment') os.makedirs(hub_prefix, exist_ok=True) subprocess.check_output(['python3', '-m', 'venv', hub_prefix], stderr=subprocess.STDOUT)