ntpdate[16603]: the NTP socket is in use

ubuntu使用ntpdate更新时间的时候提示错误如下

root@lnmp:/etc/squid3# sudo ntpdate cn.pool.ntp.org
5 Jan 07:22:59 ntpdate[4129]: the NTP socket is in use, exiting

解决方法

$ ps aux | grep ntpd #将进程号记录下来
$ sudo kill 2378 # 杀死刚才记录的进程号
$ sudo ntpdate cn.pool.ntp.org  # 再次更新