如何让 debian apt 正确找到软件包来安装 sudo

如何让 debian apt 正确找到软件包来安装 sudo

我刚刚使用完整光盘映像 (debian-9.8.0-amd64-xfce-CD-1) 安装了 debian 9,并在 Windows 10 主机的 64 位环境中的 VirtualBox 上进行安装。在安装过程中,我取消选中桌面环境和 xfce 复选框。我保留实用程序复选框处于选中状态。我这样做是因为我想留下一个轻量级安装以用作本地服务器。

尝试使用 apt 安装“sudo”包。

我已经注释掉了 CD-rom 源并将这些源添加到/etc/apt/sources.list

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

deb http://ftp.debian.org/debian/ stretch-updates main non-free
deb-src http://ftp.debian.org/debian/ stretch-updates main non-free

然后我就跑apt updateapt upgrade

除此之外,我遇到了一个问题。当我尝试运行时apt install sudo,出现以下信息:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sud 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

E: Package 'sudo' has no installation candidate

当我运行时我可以看到这是正确的,apt-cache policy sudo正如它向我显示的那样:

sudo:
  Installed: (none)
  Candidate: (none)
  Version table:

答案1

如果我正确理解了您的问题 - 您的 sources.list 文件中可能缺少一些来源。

使用 Debian 源列表生成器自动生成来源列表并相应地更新您的 sources.list。

相关内容