installing NTP on CentOS 6
Asked Answered
I

3

5

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.

Intima answered 6/8, 2013 at 20:49 Comment(4)
Which repos do you have enabled (see /etc/yum.repos.d/). Check it with something like 'grep -l "enabled=1" /etc/yum.repos.d/*.repo'Touber
ambari.repo is all that came up. In my /etc/yum.repos.d/ I have CentOS-Debuginfo.repo.bak , CentOS-Media.repo.bak , ambari.repo.Intima
ambari is from hortonworks. im following a tutorial of installing hortonworks hdp on an ec2 cluster. sites.google.com/site/howtohadoop/how-to-install-hdpIntima
This is not a Programming related question. You should better ask on serverfault.comPricilla
W
8

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

Status

And finally, enable chrony

# systemctl enable chronyd

enter image description here

Now your server will be able to automatically correct its system clock to align with the global servers.

Wulfenite answered 5/5, 2020 at 15:36 Comment(0)
T
1

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
Touber answered 6/8, 2013 at 21:27 Comment(6)
just 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'Intima
please 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'Touber
just 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.Intima
check 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.Touber
CentOS-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.Intima
Check 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.Touber
I
0

It appears the problem was that I was missing CentOS-Base.repo.

So I created the file in the /etc/yum.repos.d/ directory using vi, then copy and pasted from another CentOS-Base.repo file.

Now I can install NTP.

Intima answered 6/8, 2013 at 23:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.