尝试在我的 Ubuntu 17.04 中安装 Python 2.7 之后:
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:fkrull/deadsnakes
每当我运行更新时,我都会开始收到错误:
$ sudo apt-get update
sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]
Ign:2 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty InRelease
Ign:3 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty Release
Hit:4 http://mirrors.linode.com/ubuntu zesty InRelease
Hit:5 http://mirrors.linode.com/ubuntu zesty-updates InRelease
Hit:6 http://mirrors.linode.com/ubuntu zesty-backports InRelease
Ign:7 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main all Packages
Ign:8 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main amd64 Packages
Ign:9 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main i386 Packages
Ign:10 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en_US
Ign:11 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en
Ign:7 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main all Packages
Ign:8 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main amd64 Packages
Ign:9 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main i386 Packages
Ign:10 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en_US
Ign:11 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en
Ign:7 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main all Packages
Ign:8 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main amd64 Packages
Ign:9 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main i386 Packages
Ign:10 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en_US
Ign:11 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en
Ign:7 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main all Packages
Ign:8 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main amd64 Packages
Ign:9 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main i386 Packages
Ign:10 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en_US
Ign:11 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en
Ign:7 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main all Packages
Ign:8 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main amd64 Packages
Ign:9 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main i386 Packages
Ign:10 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en_US
Ign:11 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en
Ign:7 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main all Packages
Err:8 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main amd64 Packages
404 Not Found
Ign:9 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main i386 Packages
Ign:10 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en_US
Ign:11 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main Translation-en
Hit:12 https://deb.nodesource.com/node_7.x zesty InRelease
Fetched 89.2 kB in 0s (129 kB/s)
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu/dists/zesty/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
知道原因吗?如何解决?
我猜测这些是错误:
Err:8 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty/main amd64 Packages
404 Not Found
W: The repository 'http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu zesty Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu/dists/zesty/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
电力ppa:fkrull/deadsnakes
购买权 (Launchpad 链接) 仅支持 Ubuntu 16.04 (Xenial) 之前的版本。它根本不提供 17.04 (Zesty) 的任何软件包。
您必须再次删除该存储库,它与您的 Ubuntu 版本不兼容。
如果你使用 添加了存储库sudo add-apt-repository ppa:fkrull/deadsnakes
,则可以使用以下命令轻松地将其再次删除:
sudo add-apt-repository --remove ppa:fkrull/deadsnakes
但是,17.04 已经预装了 Python 2.7:http://packages.ubuntu.com/zesty/python
无论如何,弄乱系统的 Python 版本是危险的,因为如果您不小心删除了其中一个预装的 Python 版本或将其替换为不兼容的版本,它很容易破坏许多重要的应用程序。 保持原样就行了。