如何安装 NTP?

如何安装 NTP?

问题:

我有一个运行 Linux 的树莓派。系统日期和时间不正确。我想在上面安装NTP,这样我就可以调整时间。我可以在任何地方找到的所有说明都说使用“apt_get”来安装 NTP。然而,我的 pi 上似乎没有安装 apt,因为每当我尝试使用它时,都会收到消息“apt-get”未找到。

我做了什么:

我一直尝试用 dpkg 安装 apt 但没有成功。我找到了一些说明这里说我可以用

wget http://mirrordirector.raspbian.org/raspbian/pool/main/a/apt/apt_0.9.7.7+rpi1_armhf.deb

下载 apt 的软件包,但我从提供的 URL 收到 404 错误。我那么什么时候http://mirrordirector.raspbian.org/raspbian/pool/main/a/apt/在我的浏览器中并尝试下载可用的软件包之一

一旦我有了一个包,我尝试使用它来安装它,dpkg -i apt_1.4.6_armhf.deb但出现以下错误:

dpkg: error processing archive apt_1.4.6_armhf.deb (--install):
 package architecture (armhf) does not match system (armel)
Errors were encountered while processing:
 apt_1.4.6_armhf.deb

然后我找到了另一个站点(archive.debian.org/debian/pool/main/a/apt/),其中包含名称中包含“armel”而不是“armhf”的软件包,并将其下载并尝试使用安装新dpkg -i apt_0.7.20.2\+lenny2_armel.deb 软件包结果出现以下错误:

(Reading database ... 333 files and directories currently installed.)
Preparing to unpack apt_0.7.20.2+lenny2_armel.deb ...
Unpacking apt (0.7.20.2+lenny2) over (0.7.20.2+lenny2) ...
dpkg: dependency problems prevent configuration of apt:
 apt depends on libc6 (>= 2.7-1); however:
  Package libc6 is not installed.
 apt depends on libgcc1 (>= 1:4.3); however:
  Package libgcc1 is not installed.
 apt depends on libstdc++6 (>= 4.3); however:
  Package libstdc++6 is not installed.
 apt depends on debian-archive-keyring; however:
  Package debian-archive-keyring is not installed.

dpkg: error processing package apt (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 apt

我现在不知道该怎么办。我是否需要找到一种方法来安装所有这些缺失的库,或者有人知道安装 NTP 的更好方法吗?

答案1

正如您在问题顶部(在背景下)所述,您实际上是在尝试安装NTP.

您的教程很可能假设您正在使用UbuntuDebian 或其他基于 Debian 的发行版,因为它是主要的 Linux 操作系统集。其他评论也同意您可能正在使用非 PIXEL 桌面。

如果您正在使用RedhatCentOS,请尝试使用yum install [program]

如果您正在使用Debian或基于 off 的操作系统Debian,请使用apt-get install [program],但是,您似乎并未使用 onDebian

如果您正在使用Fedora,请使用yum install [program].

如果您正在使用OpenSUSE,请使用rpm -i [program].rpm.

如果这些都不起作用,请.tar.gz从以下位置下载软件包这里使用wget [programlink], -> unpack-> ./configure-> make-> make install

来源:

https://superuser.com/questions/125933

相关内容