3

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
  • 6,479
  • 17
  • 54
  • 71
  • 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' – deagh Aug 06 '13 at 21:12
  • 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. – brno792 Aug 06 '13 at 21:18
  • ambari is from hortonworks. im following a tutorial of installing hortonworks hdp on an ec2 cluster. https://sites.google.com/site/howtohadoop/how-to-install-hdp – brno792 Aug 06 '13 at 21:19
  • This is not a Programming related question. You should better ask on [serverfault.com](http://serverfault.com) – jgb Aug 07 '13 at 06:27

3 Answers3

6

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.

sonAndrew
  • 130
  • 2
  • 9
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
deagh
  • 2,647
  • 1
  • 30
  • 29
  • 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' – brno792 Aug 06 '13 at 21:38
  • 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' – deagh Aug 06 '13 at 21:48
  • 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. – brno792 Aug 06 '13 at 21:55
  • 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. – deagh Aug 06 '13 at 22:08
  • 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. – brno792 Aug 06 '13 at 22:16
  • Check this link for a valid 'CentOS-Base.repo' http://pastebin.com/fgrtYNzP I have no CentOS6 installation handy. Maybe you have to adjust the 'gpgkey' to fit your version. – deagh Aug 06 '13 at 22:23
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.

brno792
  • 6,479
  • 17
  • 54
  • 71