2

I want to install ntpdate as usual on CentOS8. However, it is not available:

# cat /proc/version
Linux version 4.18.0-240.1.1.el8_3.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Thu Nov 19 17:20:08 UTC 2020

# yum install -y ntpdate
Last metadata expiration check: 2:21:14 ago on Mon 11 Apr 2022 07:39:43 PM CST.
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
No match for argument: ntpdate
Error: Unable to find a match: ntpdate

Besides, I also find links lynx unavailable. Is there any way to install ntpdate on CenOS 8 ?

George Y
  • 528
  • 6
  • 16
  • `ntpdate` has been deprecated for quite a while since `ntpd` already has the same functionality. – stark Apr 11 '22 at 16:03

2 Answers2

2

Red Hat stopped packaging ntpd as of EL8, replaced with chrony.

chronyd -Q will query for the offset and quit. Use -f option to provide a config file with different NTP servers.

Other useful commands: chronyc sources -v or chronyc sourcestats -v will show details on configured sources.


Text browsers for CentOS Stream 8 are for some reason in the powertools repo. (But lynx is in Stream 9 AppStream for reasons I don't understand.)

  dnf --enablerepo=powertools list elinks lynx

When you know a package exists, but are unsure of which repo it might be in, there are search engines like pkgs.org. Keep in mind repos are of varying quality and care to avoid conflicts, CentOS wiki has strong opinions on repos.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • But how to use chrony, say, calibrate the time to a host like `time.windows.com`? – George Y Apr 12 '22 at 12:41
  • 1
    `server time.windows.com` in chrony.conf like any other NTP source. However I personally do not like Windows time service as it appears to still not have IPv6 in the year 2022. – John Mahowald Apr 12 '22 at 19:19
  • The main use of ntpdate is to do the initial sync with a remote NTP server like this: `# ntpdate 10.247.19.254` and this response does not explain how to replace this in CentOS 8, so it should not be condidered an answer to the question – Luis Vazquez Apr 13 '23 at 15:31
0

As stated in the response from @JohnMahowald ntpdate is not included in RedHat Based distros starting with CentOS/EL 8 as all the client NTP functionality (service and command line tools) has been repaced by chrony.

The main use of ntpdate was the initial testing and sync with a remote server like this:

# ntpdate 0.pool.ntp.org
13 Apr 12:38:54 ntpdate[29547]: adjust time server 190.64.134.53 offset 0.008546 sec

As long as I know there is not an exact equivalent command for this in EL8, but something similar can now be accomplished by using chronyd like this:

# chronyd -q 'server 0.pool.ntp.org iburst'
...
2023-04-13T15:39:48Z Initial frequency -13.600 ppm
2023-04-13T15:39:53Z System clock wrong by 0.003503 seconds (step)
2023-04-13T15:39:53Z chronyd exiting

And then you can configure your servers in /etc/chrony.conf start the chronyd service and do an initial quick sync with the following command:

# systemctl restart chronyd
# chronyc -a makestep
200 OK

For more details see: How to resynchronize with chrony?

Luis Vazquez
  • 228
  • 2
  • 5