sudo apt update sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt install python3.9 Disclaimer: there's no guarantee of timely updates in case of security problems or other issues.