E:软件包‘python’没有安装候选项

E:软件包‘python’没有安装候选项

最近我一直在尝试一些黑客工具(如 hydro),并且我遇到了一个名为 Responder 的工具。它基本上会打开一个 SMB 服务器,从服务器/客户端抓取管理员用户的 NetNTLMv(顺便说一句,我还是个初学者,所以如果我错了,请多包涵)。我尝试通过键入来运行脚本,./Responder.py -I tun0但它显示/usr/bin/env: ‘python’: No such file or directory。我知道 python 未安装,所以我运行了,sudo apt install python但它没有告诉我安装已完成,而是告诉我以下内容:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  2to3 python2-minimal:i386 python2:i386 python2-minimal python2 dh-python
  python-is-python3

E: Package 'python' has no installation candidate

sudo apt update && sudo apt upgrade即使在运行和重启后,输出仍然保持不变。

我记得上次更新之前 python 还可以运行,所以我不太清楚该怎么做。

版本:Ubuntu 22.04 amd64

(注意:我进入了 Responder.py 代码,发现在 shebang 行中,它特别需要 python 1,因此 python 2 和 3 不应该工作...我还是尝试了一下,但正如我猜测的那样,它没有工作。)

答案1

所有最近的 Ubuntu 安装python3仅使用。

要运行指向的程序python,请安装包python-is-python3

sudo apt install python-is-python3

或者手动创建一个符号链接python3(这基本上就是上面的包所做的):

sudo ln -s /usr/bin/python3 /usr/bin/python

答案2

如果你想在 Ubuntu 22.04 上安装 Python 2,方法如下:

$ sudo apt update
$ sudo apt install python2

$ python2 -V
Python 2.7.18

但是,如上所述,Python 2.7 已终止使用(截至 2020-01-01),并且在最近的 Ubuntu 版本中已被弃用。


如果你真的需要 Python 1.x ... 您需要下载 1.6.1 的源代码并自行构建。这有点疯狂... 因为 1.6.1 已于 2000 年正式停产。

相关内容