来自 deadsnakeshttp://ppa.launchpad.net/deadsnakes/ppa/ubuntulibpython3.9-stdlib 依赖于 libmpdec2,但据我所知,它在 22.04 LTS (jammy) 上不可用,请参阅https://packages.ubuntu.com/search?keywords=libmpdec2。页面显示 libmpdec2 适用于 18.04 LTS 和 20.04 LTS。这种情况下该怎么办?
答案1
您已直接链接到PPA 的文件系统,而不是PPA 本身。这让我怀疑您正在抓取 deb 并手动安装它们,而不是正确添加 repo 并使用apt
?这可能是导致您出现问题的原因。这绝对不是从 PPA 安装软件包的方式。
我刚刚启动了一个 22.04 容器并通过以下方式正确添加了 PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
然后通过以下方式安装python3.9:
apt install python3.9
它工作正常。
root@sunny-shepherd:~# apt install python3.9
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
bzip2 libpython3.9-minimal libpython3.9-stdlib mailcap mime-support
python3.9-minimal
Suggested packages:
bzip2-doc python3.9-venv binfmt-support
The following NEW packages will be installed:
bzip2 libpython3.9-minimal libpython3.9-stdlib mailcap mime-support
python3.9 python3.9-minimal
0 upgraded, 7 newly installed, 0 to remove and 3 not upgraded.
Need to get 5306 kB of archives.
After this operation, 19.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
安装了所有正确的软件包:
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 bzip2 amd64 1.0.8-5build1 [34.8 kB]
Get:2 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 libpython3.9-minimal amd64 3.9.16-1+jammy1 [834 kB]
Get:3 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 python3.9-minimal amd64 3.9.16-1+jammy1 [2073 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 mailcap all 3.70+nmu1ubuntu1 [23.8 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 mime-support all 3.66 [3696 B]
Get:6 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 libpython3.9-stdlib amd64 3.9.16-1+jammy1 [1841 kB]
Get:7 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy/main amd64 python3.9 amd64 3.9.16-1+jammy1 [495 kB]
Fetched 5306 kB in 1s (4821 kB/s)
Selecting previously unselected package libpython3.9-minimal:amd64.
(Reading database ... 33796 files and directories currently installed.)
Preparing to unpack .../0-libpython3.9-minimal_3.9.16-1+jammy1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.16-1+jammy1) ...
Selecting previously unselected package python3.9-minimal.
Preparing to unpack .../1-python3.9-minimal_3.9.16-1+jammy1_amd64.deb ...
Unpacking python3.9-minimal (3.9.16-1+jammy1) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../2-bzip2_1.0.8-5build1_amd64.deb ...
Unpacking bzip2 (1.0.8-5build1) ...
Selecting previously unselected package mailcap.
Preparing to unpack .../3-mailcap_3.70+nmu1ubuntu1_all.deb ...
Unpacking mailcap (3.70+nmu1ubuntu1) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../4-mime-support_3.66_all.deb ...
Unpacking mime-support (3.66) ...
Selecting previously unselected package libpython3.9-stdlib:amd64.
Preparing to unpack .../5-libpython3.9-stdlib_3.9.16-1+jammy1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.16-1+jammy1) ...
Selecting previously unselected package python3.9.
Preparing to unpack .../6-python3.9_3.9.16-1+jammy1_amd64.deb ...
Unpacking python3.9 (3.9.16-1+jammy1) ...
Setting up libpython3.9-minimal:amd64 (3.9.16-1+jammy1) ...
Setting up bzip2 (1.0.8-5build1) ...
Setting up python3.9-minimal (3.9.16-1+jammy1) ...
Setting up mailcap (3.70+nmu1ubuntu1) ...
Setting up mime-support (3.66) ...
Setting up libpython3.9-stdlib:amd64 (3.9.16-1+jammy1) ...
Setting up python3.9 (3.9.16-1+jammy1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
测试:
python3.9 --version
Python 3.9.16