在Centos8的以前版本,时间同步需要yum安装ntp软件,然后执行/usr/sbin/ntpdate time.windows.com.cn (/usr/sbin/ntpdate是同步命令,time.windows.com.cn时间服务器)命令,就能实现和互联网的时间服务器的时间一致。但是在Centos8中,yum install ntp时提示没有ntp安装软件。
ntpdate方法:
添加wlnmp的yum源:
rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
安装时间同步软件:
yum install wntp
测试:
date#显示当前的时间
date -s 2010/01/01#修改时间
date#显示修改后的当前时间
ntpdate ntp1.aliyun.com#同步时间
date#显示当前时间
可以把时间同步加入到定时同步,保证系统时间实时和互联网的时间一致。
在Centos8的以前版本,时间同步需要yum安装ntp软件,然后执行/usr/sbin/ntpdate time.windows.com.cn (/usr/sbin/ntpdate是同步命令,time.windows.com.cn时间服务器)命令,就能实现和互联网的时间服务器的时间一致。但是在Centos8中,yum install ntp时提示没有ntp安装软件。
ntpdate方法:
添加wlnmp的yum源:
rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
安装时间同步软件:
yum install wntp
测试:
date#显示当前的时间
date -s 2010/01/01#修改时间
date#显示修改后的当前时间
ntpdate ntp1.aliyun.com#同步时间
date#显示当前时间
可以把时间同步加入到定时同步,保证系统时间实时和互联网的时间一致。
- 文章来源:51cto博客
- 转载说明:仅为促进国内科技技术发展,为IT工作者解决开发难题。
- 版权声明:文章来源于网络采集,版权归原创者所有,均已注明来源,如未注明可能来源未知,如有侵权请联系管理员删除。