Merge "Pre-install python3 for CentOS"
This commit is contained in:
commit
ce3b6afd4d
25
diskimage_builder/elements/yum/pre-install.d/00-1-centos-python3
Executable file
25
diskimage_builder/elements/yum/pre-install.d/00-1-centos-python3
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
set -eu
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
# Ensure the python3 interpreter and YAML libraries are installed
|
||||||
|
# early (even before package-installs, which is written in Python and
|
||||||
|
# uses YAML).
|
||||||
|
|
||||||
|
if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 7 ]]; then
|
||||||
|
# Our package map and install stuff doesn't have a way to say
|
||||||
|
# "install this from EPEL". So we hack in an install of it here
|
||||||
|
# from EPEL. Nothing else should have installed EPEL at this
|
||||||
|
# early stage.
|
||||||
|
yum install -y python3 epel-release
|
||||||
|
yum install -y python36-PyYAML
|
||||||
|
yum remove -y epel-release
|
||||||
|
elif [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} > 7 ]]; then
|
||||||
|
# For 8 and above ensure the "user" python3 package is installed
|
||||||
|
# so we have /usr/bin/python3 and pyyaml.
|
||||||
|
dnf install -y python3 python3-pyyaml
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user