To answer your question, we usually installed python3.9 on Ubuntu 20.04 like so:
DEBIAN_FRONTEND=noninteractive apt-get -y install -m -f python3.9 python3.9-distutils update-alternatives --install /usr/bin/python python /usr/bin/python3.9 10 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py After the issue was discovered, we work around the issue as follows: DEBIAN_FRONTEND=noninteractive apt-get install -y cloud-init=23.1.2-0ubuntu0~20.04.2 --allow-downgrades apt-mark hold cloud-init DEBIAN_FRONTEND=noninteractive apt-get -y install -m -f python3.9 python3.9-distutils update-alternatives --install /usr/bin/python python /usr/bin/python3.9 10 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3.9 get-pip.py -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2066066 Title: cloud-init startup failure with Python 3.9.5, Ubuntu Focal To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2066066/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs