具體怎麼安裝,可以參考:Ubuntu20.04 從原始碼編譯安裝 python3.10
在 ubuntu22.04 上,我已經從原始碼編譯安裝了多個 python 了:3.7、3.8、3.9、3.11
╭─pon@amd5700g ~
╰─➤ cd ~/opt/python/cpython/
╭─pon@amd5700g ~/opt/python/cpython
╰─➤ ll
inode Permissions Links Size Blocks User Group Date Modified Name
17728017 drwxrwxr-x 6 - - pon pon 2 5月 01:25 python3.7
16261056 drwxrwxr-x 6 - - pon pon 14 1月 19:34 python3.8
16275536 drwxrwxr-x 6 - - pon pon 14 1月 19:34 python3.9
16663293 drwxrwxr-x 6 - - pon pon 5 2月 21:32 python3.11