Skip to content

Commit 34b0396

Browse files
authored
Merge pull request #681 from StackStorm/u16-py3-ppa
Ubuntu Xenial Warning: Block python3.6 PPA installation waiting on user's agreement
2 parents b4a30c5 + aaeea50 commit 34b0396

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

scripts/st2bootstrap-deb.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,34 @@ setup_args() {
112112
exit 1
113113
fi
114114
fi
115+
116+
# Python 3.6 package is not available in Ubuntu Xenial
117+
# Installer can add it via 3rd party PPA based on user agreement
118+
if [[ "$SUBTYPE" = 'xenial' ]]; then
119+
sudo apt-get update > /dev/null 2>/dev/null
120+
# check if python3.6 is available
121+
if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then
122+
echo ""
123+
echo "WARNING!"
124+
echo "The python3.6 package is a required dependency for the StackStorm st2 package but that is not installable from any of the default Ubuntu 16.04 repositories."
125+
echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS. Support for Ubuntu 16.04 will be removed with future StackStorm versions."
126+
echo ""
127+
echo "Alternatively we'll try to add python3.6 from the 3rd party 'deadsnakes' repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa."
128+
echo "By continuing you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04."
129+
echo ""
130+
read -p "Press [y] to continue or [n] to cancel adding it: " choice
131+
case "$choice" in
132+
y|Y )
133+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
134+
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
135+
;;
136+
* )
137+
echo "python3.6 PPA installation aborted"
138+
exit 1
139+
;;
140+
esac
141+
fi
142+
fi
115143
}
116144

117145

scripts/st2bootstrap-deb.template.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,34 @@ setup_args() {
104104
exit 1
105105
fi
106106
fi
107+
108+
# Python 3.6 package is not available in Ubuntu Xenial
109+
# Installer can add it via 3rd party PPA based on user agreement
110+
if [[ "$SUBTYPE" = 'xenial' ]]; then
111+
sudo apt-get update > /dev/null 2>/dev/null
112+
# check if python3.6 is available
113+
if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then
114+
echo ""
115+
echo "WARNING!"
116+
echo "The python3.6 package is a required dependency for the StackStorm st2 package but that is not installable from any of the default Ubuntu 16.04 repositories."
117+
echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS. Support for Ubuntu 16.04 will be removed with future StackStorm versions."
118+
echo ""
119+
echo "Alternatively we'll try to add python3.6 from the 3rd party 'deadsnakes' repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa."
120+
echo "By continuing you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04."
121+
echo ""
122+
read -p "Press [y] to continue or [n] to cancel adding it: " choice
123+
case "$choice" in
124+
y|Y )
125+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
126+
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
127+
;;
128+
* )
129+
echo "python3.6 PPA installation aborted"
130+
exit 1
131+
;;
132+
esac
133+
fi
134+
fi
107135
}
108136

109137

0 commit comments

Comments
 (0)