Python 3.8 - Failed to fetch http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/dists/hirsute/main/binary-i386/Packages 404 Not Found
This is totally unsupported, but for most interim releases, you can get away with installing packages from a previous release. This is never guaranteed to work. For example, previously, I was able to edit the sources.list.d
entry for Groovy to refer to Focal, and everything worked fine.
For Hirsute, since the system python is python3.9
, you need to be extra careful not to replace that package. You also need to go through some extra steps with package pinning to avoid it. Also, the Focal repo won't provide python3.8
, so you need another repo and pin rule to bring that in from Bionic. Here's the setup, which I wrote up in more detail here.
/etc/apt/sources.list.d/deadsnakes.list
:
deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ focal main
deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ bionic main
/etc/apt/preferences.d/deadsnakes
:
Explanation: Prevent installing from deadsnakes repo.
Package: *
Pin: release o=LP-PPA-deadsnakes
Pin-Priority: 1
Explanation: Allow installing python 3.{6,7} from deadsnakes/focal
Package: *python3.6* *python3.7*
Pin: release o=LP-PPA-deadsnakes,n=focal
Pin-Priority: 500
Explanation: Allow installing python 3.8 from deadsnakes/bionic
Package: *python3.8*
Pin: release o=LP-PPA-deadsnakes,n=bionic
Pin-Priority: 500
Be sure to run sudo apt update
to refresh repository metadata, and then you should be able to install alternative Python package versions.
Note that if you go this route, you're signing up to make sure you audit all of your repos and pinning rules after each release upgrade, since they'll generally get disabled. You're also signing up to maybe have some debugging from messing things up. Please don't bother the deadsnakes repository maintainers with issues you encounter from doing this. They do not support non-LTS releases.