ubuntu ROS 系统时间同步

时间同步

出现这个问题时需要时间同步isi@isi:~/peak-linux-driver-7.6/test$ makemake: *** 警告:文件“Makefile”的修改时间在将来4.8e+08make: 没有什么可以做的为 `all'。make: 警告:检测到时钟错误。您的创建可能是不完整的。下面介绍一下与时间服务器上的时间同步的方法

1. 安装ntpdate工具

sudo apt-get install ntpdate

2. 设置系统时间与网络时间同步

sudo ntpdate cn.pool.ntp.org

3. 将系统时间写入硬件时间

sudo hwclock --systohc

4. 常见问题

4.1 更新时间的时候出现:ntpdate[23051]: the NTP socket is in use, exiting

这是因为ntp进程已经启动,那么需要将他关掉,首先查看哪个进程使用ntp

ps aux | grep ntp

扫描二维码关注公众号,回复: 1502116 查看本文章

执行命令后,会看到如下

USER PID  %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

ntp 1928 0.0 0.0 31512 4356  ? Ss 08:15 0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 117:126

找到对应的进程PID,kill,然后在同步时间

猜你喜欢

转载自blog.csdn.net/hanshuning/article/details/79460099