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§ion=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§ion=all
|
|
|
|
# https://packages.ubuntu.com/jammy-updates/libpython2.7-stdlib
|
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 03:21:01 +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
|
2023-04-11 13:27:28 +00:00
|
|
|
# `apt info libpython2.7-stdlib`
|
2023-04-05 18:02:43 +00:00
|
|
|
cd /tmp
|
|
|
|
case $ARCH in
|
2023-04-12 04:13:25 +00:00
|
|
|
#"amd64")
|
|
|
|
#wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/p/python2.7/libpython2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
|
|
|
#apt install ./libpython2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
2023-04-06 21:17:44 +00:00
|
|
|
|
2023-04-12 04:13:25 +00:00
|
|
|
#wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/p/python2.7/libpython2.7-stdlib_2.7.18-13ubuntu2_amd64.deb
|
|
|
|
#apt install ./libpython2.7-stdlib_2.7.18-13ubuntu2_amd64.deb
|
2023-04-06 21:17:44 +00:00
|
|
|
|
2023-04-12 04:13:25 +00:00
|
|
|
#wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/p/python2.7/python2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
|
|
|
#apt install ./python2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
2023-04-06 21:17:44 +00:00
|
|
|
|
2023-04-12 04:13:25 +00:00
|
|
|
#wget http://mirrors.kernel.org/ubuntu/pool/universe/p/python2.7/python2.7_2.7.18-13ubuntu2_amd64.deb
|
|
|
|
#apt install ./python2.7_2.7.18-13ubuntu2_amd64.deb
|
|
|
|
#rm *.deb
|
2023-04-12 03:21:01 +00:00
|
|
|
;;
|
2023-04-06 21:17:44 +00:00
|
|
|
|
2023-04-12 04:13:25 +00:00
|
|
|
#"arm64")
|
|
|
|
#wget http://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8_arm64.deb
|
|
|
|
#apt install ./libpython2.7-minimal_2.7.18-8_arm64.deb
|
2023-04-12 03:34:00 +00:00
|
|
|
|
2023-04-12 04:13:25 +00:00
|
|
|
#wget http://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8_arm64.deb
|
|
|
|
#apt install ./libpython2.7-stdlib_2.7.18-8_arm64.deb
|
2023-04-12 03:34:00 +00:00
|
|
|
|
2023-04-12 04:13:25 +00:00
|
|
|
#wget http://ftp.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8_arm64.deb
|
|
|
|
#apt install ./python2.7-minimal_2.7.18-8_arm64.deb
|
2023-04-12 03:34:00 +00:00
|
|
|
|
2023-04-12 04:13:25 +00:00
|
|
|
#wget http://ftp.debian.org/debian/pool/main/p/python2.7/python2.7_2.7.18-8_arm64.deb
|
|
|
|
#apt install ./python2.7_2.7.18-8_arm64.deb
|
|
|
|
#rm *.deb
|
|
|
|
#;;
|
2023-04-12 03:34:00 +00:00
|
|
|
|
2023-04-11 13:38:37 +00:00
|
|
|
# trusted is used for Debian and RasPiOS as the keys would be missing for Ubuntu
|
2023-04-12 04:13:25 +00:00
|
|
|
"arm64"|"amd64")
|
|
|
|
apt -y install ubuntu-keyring
|
|
|
|
cat << EOF >> /etc/apt/sources.list.d/python2.list
|
|
|
|
deb [trusted=yes] http://ports.ubuntu.com/ jammy main universe
|
|
|
|
deb [trusted=yes] http://ports.ubuntu.com/ jammy-updates main universe
|
|
|
|
EOF
|
|
|
|
;;
|
2023-04-08 07:49:06 +00:00
|
|
|
|
2023-04-05 18:02:43 +00:00
|
|
|
"armhf")
|
2023-04-11 13:27:28 +00:00
|
|
|
#wget http://raspbian.raspberrypi.org/raspbian/pool/main/libf/libffi/libffi7_3.3-6_armhf.deb
|
|
|
|
#apt install ./libffi7_3.3-6_armhf.deb
|
2023-04-06 22:15:33 +00:00
|
|
|
|
2023-04-11 13:27:28 +00:00
|
|
|
#wget http://raspbian.raspberrypi.org/raspbian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-13.2_armhf.deb
|
|
|
|
#apt install ./libpython2.7-minimal_2.7.18-13.2_armhf.deb
|
2023-04-06 22:15:33 +00:00
|
|
|
|
2023-04-11 13:27:28 +00:00
|
|
|
#wget http://raspbian.raspberrypi.org/raspbian/pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-13.2_armhf.deb
|
|
|
|
#apt install ./libpython2.7-stdlib_2.7.18-13.2_armhf.deb
|
2023-04-06 22:15:33 +00:00
|
|
|
|
2023-04-11 13:27:28 +00:00
|
|
|
#wget http://raspbian.raspberrypi.org/raspbian/pool/main/p/python2.7/python2.7-minimal_2.7.18-13.2_armhf.deb
|
|
|
|
#apt install ./python2.7-minimal_2.7.18-13.2_armhf.deb
|
2023-04-06 22:15:33 +00:00
|
|
|
|
2023-04-11 13:27:28 +00:00
|
|
|
#wget http://raspbian.raspberrypi.org/raspbian/pool/main/p/python2.7/python2.7_2.7.18-13.2_armhf.deb
|
|
|
|
#apt install ./python2.7_2.7.18-13.2_armhf.deb
|
|
|
|
#rm *.deb
|
2023-04-11 13:38:37 +00:00
|
|
|
|
2023-04-11 14:29:22 +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-11 13:38:37 +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-12 03:21:01 +00:00
|
|
|
apt update
|
|
|
|
apt -y install python2
|
|
|
|
rm /etc/apt/sources.list.d/python2.list || true
|
|
|
|
apt update
|
2023-04-05 18:02:43 +00:00
|
|
|
;;
|
|
|
|
esac
|