installing NTP on CentOS 6
Solution 1
I was having a problem getting NTP up and running as well. I found that the ntp package is no longer supported in RHEL 8 and so no longer supported in CentOS and its versions. The synchronization of clocks of computers over a network can now be implemented by the chrony package using chronyd.
The chrony package is a versatile implementation of the Network Time Protocol(NTP) and works both as an NTP server and as an NTP client.
This package should already be included by default starting from RHEL 8 and CentOS 7. If it is not included for some reason you can install it, start it, check status, and enable it using the commands below:
# sudo dnf install chrony
To start :
# systemctl start chronyd
Make sure it is working by checking the status
# systemctl status chronyd
And finally, enable chrony
# systemctl enable chronyd
Now your server will be able to automatically correct its system clock to align with the global servers.
Solution 2
It seems like your active repo do not provide all needed packages. Try to add a repo (ex. EPEL)
For a detailed howto install see http://fedoraproject.org/wiki/EPEL
After that try again to install ntp with
yum install ntp
brno792
Updated on June 04, 2022Comments
-
brno792 almost 2 years
I am running CentOS Linux release 6.0 (Final) on amazon ec2.
I'm trying to install NTP (network time protocol), but am getting errors.
Im logged in as root and am in the root directory. I type
yum -y install ntp
and get "No package ntp available".I have also tried
install ntp
,sudo install ntp
,yum install ntp
,yum install -y ntp
all yield the same "No package ntp available" message.When I type
yum search ntp
I get "No Matches found".Based on everything I've researched, yum should find ntp and the install commands should install it and start the daemon ntpd. Please advise.
-
brno792 over 10 yearsjust tried that. ran the 'rpm -Uvh fedora-epel ... url' command. Now my yum.repos.d directory also has epel.repo and epel-testing.repo. I still get the 'No package ntp available' when running 'yum install ntp'
-
deagh over 10 yearsplease verify that EPEL is active with 'yum repolist all' then clean your local cache with 'yum clean all' and try it again 'yum install ntp'
-
brno792 over 10 yearsjust ran those commands again. it shows 'epel' is enabled. ntp package still not available. 'c6-media' and 'debug' are disabled however. How do I enable those? Could there be other repos missing? Base for example? but i dont get why thats not here, nothing was deleted from original distro setup.
-
deagh over 10 yearscheck if enabled=1 within '/etc/yum.repos.d/CentOS-Base.repo'. Mainly [base], [updates] and [extras]. If this file is missing check your nearest centOS mirror.
-
brno792 over 10 yearsCentOS-Base.repo is missing, which makes no sense to me. But thats how the ec2 server came. How do I install CentOS-Base.repo if I need it? Thanks. Im pretty new to linux and centos.
-
deagh over 10 yearsCheck this link for a valid 'CentOS-Base.repo' pastebin.com/fgrtYNzP I have no CentOS6 installation handy. Maybe you have to adjust the 'gpgkey' to fit your version.