
Use the following command: $ sudo apt install wget software-properties-common build-essential libnss3-dev zlib1g-dev libgdbm-dev libncurses5-dev libssl-dev libffi-dev libreadline-dev libsqlite3-dev libbz2-dev For this purpose, we have to install the dependency packages. Now comes the part where we start working on the installation of Python 3.9.

Now that we have successfully upgraded our system, let’s restart it with the following command: $ sudo reboot However, in my case it wasn’t necessary as you can see all the packages are up to date. If there are some packages that need to be upgraded then type the following command: $ sudo apt upgrade

For this purpose type the following command: $ sudo apt update

The first step in installing Python 3.9 in our Debian 11 is to update the apt cache index.
