今天查看公司服务器,发现rsync同步有问题,检查了时间,源服务器是在美国,而客户端服务器是国内时间,所以打算使用ntpdate 命令更新一下服务器时间,结果提示没有此命令,心想就安装下。结果却报错了。
错误提示如下:
“错误:openntpd conflicts with ntpdate-4.2.6p5-5.el6.centos.4.x86_64”
[root@server ~]# yum install -y ntp* 已加载插件:fastestmirror, security 设置安装进程 Loading mirror speeds from cached hostfile * base: mirror.sesp.northwestern.edu * extras: mirror.pac-12.org * updates: centos-distro.cavecreek.net 解决依赖关系 --> 执行事务检查 ---> Package ntp.x86_64 0:4.2.6p5-5.el6.centos.4 will be 安装 ---> Package ntp-doc.noarch 0:4.2.6p5-5.el6.centos.4 will be 安装 ---> Package ntp-perl.x86_64 0:4.2.6p5-5.el6.centos.4 will be 安装 ---> Package ntpdate.x86_64 0:4.2.6p5-5.el6.centos.4 will be 安装 --> 处理 openntpd-3.9p1-1.el6.x86_64 与 ntp 的冲突 --> 处理 openntpd-3.9p1-1.el6.x86_64 与 ntpdate 的冲突 --> 完成依赖关系计算 错误:openntpd conflicts with ntpdate-4.2.6p5-5.el6.centos.4.x86_64 错误:openntpd conflicts with ntp-4.2.6p5-5.el6.centos.4.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
解决方法:
先卸载服务器上的openntpd服务,两者安装会有冲突。
[root@server ~]# yum remove openntpd 已加载插件:fastestmirror, security 设置移除进程 解决依赖关系 --> 执行事务检查 ---> Package openntpd.x86_64 0:3.9p1-1.el6 will be 删除 --> 完成依赖关系计算 依赖关系解决 ============================================================================================================================================================================================= 软件包 架构 版本 仓库 大小 ============================================================================================================================================================================================= 正在删除: openntpd x86_64 3.9p1-1.el6 installed 105 k 事务概要 ============================================================================================================================================================================================= Remove 1 Package(s) Installed size: 105 k 确定吗?[y/N]:y 下载软件包: 运行 rpm_check_debug 执行事务测试 事务测试成功 执行事务 正在删除 : openntpd-3.9p1-1.el6.x86_64 1/1 Verifying : openntpd-3.9p1-1.el6.x86_64 1/1 删除: openntpd.x86_64 0:3.9p1-1.el6 完毕! You have mail in /var/spool/mail/root [root@server ~]# yum install -y ntp* 已加载插件:fastestmirror, security 设置安装进程 Loading mirror speeds from cached hostfile * base: mirror.sesp.northwestern.edu * extras: mirror.pac-12.org * updates: centos-distro.cavecreek.net base | 3.7 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 解决依赖关系 --> 执行事务检查 ---> Package ntp.x86_64 0:4.2.6p5-5.el6.centos.4 will be 安装 ---> Package ntp-doc.noarch 0:4.2.6p5-5.el6.centos.4 will be 安装 ---> Package ntp-perl.x86_64 0:4.2.6p5-5.el6.centos.4 will be 安装 ---> Package ntpdate.x86_64 0:4.2.6p5-5.el6.centos.4 will be 安装 --> 完成依赖关系计算 依赖关系解决 ============================================================================================================================================================================================= 软件包 架构 版本 仓库 大小 ============================================================================================================================================================================================= 正在安装: ntp x86_64 4.2.6p5-5.el6.centos.4 updates 595 k ntp-doc noarch 4.2.6p5-5.el6.centos.4 updates 1.0 M ntp-perl x86_64 4.2.6p5-5.el6.centos.4 updates 29 k ntpdate x86_64 4.2.6p5-5.el6.centos.4 updates 77 k 事务概要 ============================================================================================================================================================================================= Install 4 Package(s) 总下载量:1.7 M Installed size: 3.4 M 下载软件包: (1/4): ntp-4.2.6p5-5.el6.centos.4.x86_64.rpm | 595 kB 00:00 (2/4): ntp-doc-4.2.6p5-5.el6.centos.4.noarch.rpm | 1.0 MB 00:00 (3/4): ntp-perl-4.2.6p5-5.el6.centos.4.x86_64.rpm | 29 kB 00:00 (4/4): ntpdate-4.2.6p5-5.el6.centos.4.x86_64.rpm | 77 kB 00:00 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 总计 8.2 MB/s | 1.7 MB 00:00 运行 rpm_check_debug 执行事务测试 事务测试成功 执行事务 正在安装 : ntpdate-4.2.6p5-5.el6.centos.4.x86_64 1/4 正在安装 : ntp-4.2.6p5-5.el6.centos.4.x86_64 2/4 正在安装 : ntp-doc-4.2.6p5-5.el6.centos.4.noarch 3/4 正在安装 : ntp-perl-4.2.6p5-5.el6.centos.4.x86_64 4/4 Verifying : ntpdate-4.2.6p5-5.el6.centos.4.x86_64 1/4 Verifying : ntp-4.2.6p5-5.el6.centos.4.x86_64 2/4 Verifying : ntp-doc-4.2.6p5-5.el6.centos.4.noarch 3/4 Verifying : ntp-perl-4.2.6p5-5.el6.centos.4.x86_64 4/4 已安装: ntp.x86_64 0:4.2.6p5-5.el6.centos.4 ntp-doc.noarch 0:4.2.6p5-5.el6.centos.4 ntp-perl.x86_64 0:4.2.6p5-5.el6.centos.4 ntpdate.x86_64 0:4.2.6p5-5.el6.centos.4 完毕!
[root@server ~]# ntpdate -u pool.ntp.org 4 May 10:05:32 ntpdate[9427]: step time server 129.250.35.251 offset -28817.476816 sec [root@server ~]# date 2016年 05月 04日 星期三 10:05:34 CST
如上图,命令成功执行。
本文由 Mr Gu 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Aug 26, 2016 at 09:24 pm