这是我第一次发布问题。我已经在服务器上安装了 Ubuntu 20.04.3 LTS,以作为我的网络的 NTP 服务器。我尝试安装 NTP 服务器,但出现错误:
$ sudo apt-get install ntp
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ntp : Depends: libopts25 (>= 1:5.18.16) but it is not installable
Recommends: sntp but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我还尝试安装 sntp,以防万一,但出现同样的问题:
$ sudo apt-get install sntp
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
sntp : Depends: libopts25 (>= 1:5.18.16) but it is not installable
E: Unable to correct problems, you have held broken packages.
我也尝试了下面的命令来安装带有 NTP 的 libopts25,但同样的问题再次出现。
$ sudo apt-get install ntp libopts25
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libopts25 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 'libopts25' has no installation candidate
似乎 libopts25 包缺失或已过时 (?)。如果此包是 NTP 的依赖项,是否有其他在 Ubuntu 服务器上安装 NTP 的步骤?
该服务器可以完全访问互联网。任何建议都会有帮助。
答案1
您需要启用universe
存储库才能安装ntp
和libopts25
。请确保此行在您的/etc/apt/sources.list
:
deb http://archive.ubuntu.com/ubuntu focal universe
然后你应该能够使用以下命令进行安装:
$ sudo apt update && sudo apt install ntp