我昨天刚刚在我的联想G50-70上完成了一次全新的Ubuntu 14.04安装,卸载了Windows 10。当我启动机器时,时钟显示的时间是错误的,尽管时区设置是正确的。时钟比实际时间快了三个小时。我该如何修复时钟?
/etc/cron.daily/ntpdate
的文件,内容如下:#!/bin/sh
ntpdate ntp.ubuntu.com
sudo chmod 755 /etc/cron.daily/ntpdate
sudo hwclock --set --date "mm/dd/yyyy hh:mm:ss"
sudo hwclock -s
由utamav回答:这是在双系统中与Ubuntu/Linux共存时常见的问题。Linux从BIOS获取时间,假设它是协调世界时(UTC),而Windows则假设它是你所在地区的时间。因此,每个操作系统都会相互干扰时间。更简单的方法是在Linux中更改时间。 在Linux中,执行以下步骤:
/etc/default/rcS
UTC=yes to UTC=no
ntp
服务器。然后,输入以下内容将其设置为您的区域:sudo service ntp stop
sudo ntpdate -s YOUR TIME ZONE SERVER ADDRESS
sudo service ntp start
这应该会更新和纠正您的时间。
$ ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime