1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00
iiab/scripts/install_python2.sh

59 lines
1.9 KiB
Bash
Raw Normal View History

2023-04-05 18:02:43 +00:00
#!/bin/bash
2023-04-11 15:57:39 +00:00
# https://packages.debian.org/search?keywords=libpython2.7-stdlib&searchon=names&suite=all&section=all
2023-04-06 21:17:44 +00:00
# https://packages.debian.org/bullseye/libpython2.7-stdlib
2023-04-11 15:57:39 +00:00
# https://packages.ubuntu.com/search?keywords=libpython2.7-stdlib&searchon=names&suite=all&section=all
# https://packages.ubuntu.com/jammy-updates/libpython2.7-stdlib
2023-04-12 13:45:56 +00:00
# payload to be installed:
# libpython2-stdlib
# libpython2.7-minimal
# libpython2.7-stdlib
# python2-minimal
# python2.7-minimal
# python2.7
# python2
2023-04-12 06:58:41 +00:00
export DEBIAN_FRONTEND=noninteractive
2023-04-05 18:02:43 +00:00
ARCH=$(dpkg --print-architecture)
2023-04-06 21:17:44 +00:00
apt -y install virtualenv
2023-04-11 15:57:39 +00:00
# https://github.com/iiab/iiab/pull/3535#issuecomment-1503626474
2023-04-12 07:28:05 +00:00
#apt -y install media-types libffi8 libssl3
2023-04-06 21:17:44 +00:00
2023-04-11 14:29:22 +00:00
# libpython2.7-stdlib from ubuntu-22.04 used in amd64|arm64|armhf is compiled against libssl3 and libffi8
# `apt info libpython2.7-stdlib`
2023-04-05 18:02:43 +00:00
cd /tmp
case $ARCH in
2023-04-12 06:29:23 +00:00
"amd64")
# works on U23.04 x86_64 VM
2023-04-12 06:38:04 +00:00
cat << EOF > /etc/apt/sources.list.d/python2.list
2023-04-12 06:29:23 +00:00
deb [trusted=yes] http://archive.ubuntu.com/ubuntu jammy main universe
deb [trusted=yes] http://archive.ubuntu.com/ubuntu jammy-updates main universe
EOF
;;
2023-04-06 21:17:44 +00:00
2023-04-12 06:29:23 +00:00
"arm64")
# gave 404 errors on U23.04 x86_64 VM need to circle back to U23.04 arm64 and confirm
2023-04-12 06:38:04 +00:00
cat << EOF > /etc/apt/sources.list.d/python2.list
2023-04-12 06:29:23 +00:00
deb [trusted=yes] http://ports.ubuntu.com/ jammy main universe
deb [trusted=yes] http://ports.ubuntu.com/ jammy-updates main universe
EOF
;;
2023-04-12 06:08:39 +00:00
2023-04-05 18:02:43 +00:00
"armhf")
2023-04-12 13:45:56 +00:00
# armhf compile flags differ between RasPiOS and Ubuntu
2023-04-11 18:36:40 +00:00
if ! [ -f /etc/rpi-issue ]; then
2023-04-12 13:45:56 +00:00
# these might change
2023-04-12 06:38:04 +00:00
cat << EOF > /etc/apt/sources.list.d/python2.list
deb http://ports.ubuntu.com/ jammy main universe
deb http://ports.ubuntu.com/ jammy-updates main universe
EOF
fi
2023-04-05 18:02:43 +00:00
;;
esac
2023-04-12 04:18:53 +00:00
apt update
apt -y install python2
rm /etc/apt/sources.list.d/python2.list || true
apt update