Sync with NTP server on CentOS problem

Discussion in 'HOWTO-Related Questions' started by Sammy, Nov 6, 2008.

  1. Sammy

    Sammy New Member

    Hello !

    I have a CentOS 4.4 server running with Directadmin.

    The server clock is not correct, and I thought I could set this up once and for all useing the setup here in the tutorials.

    [B]14 Synchronize The System Clock[/B]
    If you want to have the system clock synchronized with an NTP server do the following:
    yum install ntp
    chkconfig --levels 235 ntpd on
    /etc/init.d/ntpd start
    So I logged in as root through Putty.exe on a Win PC
    and this was the output..
    [[email protected] /]# yum install ntp
    Dependencies Resolved
    Package Arch Version Repository Size
    ntp i386 4.2.0.a.20040617-8.el4.centos base 1.2 M
    Installing for dependencies:
    shadow-utils i386 2:4.0.3-66.RHEL4 base 594 k
    Transaction Summary
    Install 1 Package(s)
    Update 1 Package(s)
    Remove 0 Package(s)
    Total download size: 1.8 M
    Is this ok [y/N]: y
    Downloading Packages:
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
    error: cannot open Packages index using db3 - Permission denied (13)
    error: cannot open Packages database in /var/lib/rpm
    Dependency Installed: shadow-utils.i386 2:4.0.3-66.RHEL4
    Updated: ntp.i386 0:4.2.0.a.20040617-8.el4.centos
    [[email protected] /]# chkconfig --levels 235 ntpd on
    [[email protected] /]# ntpdate
    Error : Servname not supported for ai_socktype
    5 Nov 18:20:56 ntpdate[29521]: can't find host
    5 Nov 18:20:56 ntpdate[29521]: no servers can be used, exiting
    [[email protected] /]#

    What did I do wrong..
    What does the two error messages cannot open Packages mean..

    How to set it up?

    Sammy :)
  2. falko

    falko Super Moderator ISPConfig Developer

    Please try this:
    yum clean all
    yum makecache
  3. Sammy

    Sammy New Member

    Thanks for helping out falko.

    However - it did not solve the problem.

    I still get the errors:

    I googled the error messages and came up with this suggestion:

    However I don't want to do something that may mess up the server,
    since it's already running a few domains that has a lot of visitors.

    Can I use the above command without messing it up..?
    - Or do You suggest anything else?

    Sammy :)
  4. falko

    falko Super Moderator ISPConfig Developer

    Haven't tried that command, but if you are unsure, you can test it on a test machine first.

Share This Page