I've recently upgraded from 20.04 to 21.04. The problem is that I have many python
virtualenvs
that use python 3.8
which is not installed by default.
How can I fix the virtualenvs
so it works again?
sudo add-apt-repository ppa:deadsnakes/ppa
is telling me that:
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu hirsute Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
And sudo apt-get update --allow-insecure-repositories
:
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu hirsute Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/dists/hirsute/main/binary-i386/Packages 404 Not Found [IP: 91.189.95.85 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
EDIT:
So I'm trying to install the 3.8 from the source. I've downloaded python 3.8.9.tgz
and now I'm going to install it - will it corrupt the latest version?
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 providepython3.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
:/etc/apt/preferences.d/deadsnakes
: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.