Date 使用ntp Debian 8.9以Beaglebone黑色设置日期

Date 使用ntp Debian 8.9以Beaglebone黑色设置日期,date,debian,beagleboneblack,ntp,Date,Debian,Beagleboneblack,Ntp,我一直在尝试用我的Beaglebone Black设置正确的日期,但我尝试的解决方案不是永久性的,每次我关闭Beagle并稍后打开电源时,日期又错了。 这就是最初的样子: root@beaglebone:~# date Sat May 21 17:48:28 CDT 2016 然后我安装了ntp和ntpdate root@beaglebone:~# apt-get install ntp ntpdate Reading package lists... Done Building depend

我一直在尝试用我的Beaglebone Black设置正确的日期,但我尝试的解决方案不是永久性的,每次我关闭Beagle并稍后打开电源时,日期又错了。 这就是最初的样子:

root@beaglebone:~# date
Sat May 21 17:48:28 CDT 2016
然后我安装了ntp和ntpdate

root@beaglebone:~# apt-get install ntp ntpdate
Reading package lists... Done
Building dependency tree
Reading state information... Done
ntp is already the newest version.
ntpdate is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
之后,我像这样编辑ntp.conf文件

# pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will
# pick a different set every time it starts up.  Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
server 3.north-america.pool.ntp.org
...
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
restrict 192.168.0.11 mask 255.255.255.0 nomodify notrap
在那之后,我应该启用ntp服务

root@beaglebone:~# systemctl enable ntpdate.service
Failed to enable unit: No such file or directory

or

root@beaglebone:~# service ntpdate start
Failed to start ntpdate.service: Unit ntpdate.service not found.
我无法继续使用THA,因为我没有ntp.service文件,所以我尝试了这个

root@beaglebone:~# timedatectl set-ntp true
root@beaglebone:~# timedatectl status
      Local time: Sat 2016-05-21 18:16:10 CDT
  Universal time: Sat 2016-05-21 23:16:10 UTC
        RTC time: Sat 2016-05-21 23:16:11
       Time zone: America/Mexico_City (CDT, -0500)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

root@beaglebone:~# nano /etc/systemd/timesyncd.conf
[Time]
NTP=0.north-america.pool.ntp.org 1.north-america.pool.ntp.org 2.north-america.pool.ntp.org 3.north-america.pool.ntp.org
FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
最后,我重新启动,似乎工作

root@beaglebone:~# timedatectl status
      Local time: Sun 2017-09-10 23:32:28 CDT
  Universal time: Mon 2017-09-11 04:32:28 UTC
        RTC time: Mon 2017-09-11 04:32:28
       Time zone: America/Mexico_City (CDT, -0500)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no
但是,断电后,时间又回到了2016年5月21日。我甚至试着用HWCock--set--date“date”-localtime和systohc手动设置和同步时钟,但断电后结果是一样的

我是错过了什么还是做错了什么

我还将/etc/adjtime中的“UTC”改为“LOCAL”,时间可追溯到2016年5月

谢谢。

试试这个:

dpkg重新配置数据

这应该行得通。此时会出现提示,您可以使用图形界面对其进行配置。它和美国一样容易进入。然后,你也可以选择你的时区


Seth

尝试了,但没有成功,它设置了时区,与我在问题中发布的程序一样,但在启动时仍然重置。
root@beaglebone:~# timedatectl status
      Local time: Sun 2017-09-10 23:32:28 CDT
  Universal time: Mon 2017-09-11 04:32:28 UTC
        RTC time: Mon 2017-09-11 04:32:28
       Time zone: America/Mexico_City (CDT, -0500)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no