每个包“没有安装候选”

sal*_*402 29 ubuntu apt package-management

尝试openssh-server在 Ubuntu 14.04 64 位上安装时,出现以下错误:

Package openssh-server 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 'openssh-server' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

尝试安装任何软件包时,我看到相同的错误。

这是sources.list文件:

deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner
Run Code Online (Sandbox Code Playgroud)

Oli*_*Oli 30

如果这真的是您的整个/etc/apt/sources.list文件,那就可以解释您当前的情况。我没有解释为什么你安装了 Hardy 存储库。我怀疑你遵循了一个旧教程,它已经破坏了一些东西。

您的第一步是让您的回购重回正轨。我建议使用像RepoGen这样的工具来获取基础知识,但如果失败,以下是最重要的:

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 
Run Code Online (Sandbox Code Playgroud)

将它们贴在正确的位置sudoedit /etc/apt/sources.list(你不妨抛弃那些关于耐寒的线条)。保存后,运行sudo apt-get update,然后您应该能够再次安装。