1

I have a Python web app that uses Django.

The production server is running Debian 9 and has Python 3.5.3 installed.

I have tried to upgrade it incorrectly. This led to a major defect in the server's kernel (Panic Kernel). After getting error 503 Connection Timeout from the server, I can no longer connect to the server in any way. Is it possible for me to upgrade Python to 3.10 on Debian 9?

I ran this command:

sudo apt update && sudo apt upgrade

This was the result:

Hit:1 http://repo.mysql.com/apt/debian buster InRelease
Hit:2 http://security.debian.org stretch/updates InRelease
Ign:3 http://mirrors.digitalocean.com/debian stretch InRelease
Hit:4 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Hit:5 http://mirrors.digitalocean.com/debian stretch-updates InRelease
Hit:6 http://mirrors.digitalocean.com/debian stretch Release
Reading package lists... Done
Building dependency tree
Reading state information... Done
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
mysql-client mysql-server
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

So what should I do?

1 Answer 1

0

You're not going to be able to upgrade Python from 3.5 to 3.10 using apt. The reason is that python3.5 and python3.10 are two different programs. For Debian 9, the version of Python that corresponds to the python3 package is 3.5.

I recommend downloading and building the Python 3.10 source. You can then create a virtual environment for your project.

3
  • If I reinstall Python again will I need to configure my server settings again? Will the server be affected by that or not? Apr 12, 2023 at 20:15
  • Impossible to tell given the information you’ve provided. You should ask that as a separate question. Apr 13, 2023 at 1:57
  • 1
    Don't manually install python3.10 globally. Use a venv for your django app to keep things isolated. Apr 13, 2023 at 14:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .