6

My two Ubuntu desktops updated their time for daylight savings time but my laptop did not. I am not sure the difference. They are all set to get their time "Automatically from the Internet" and are on the same time zone. How do I get the laptop to update and continue to stay in sync using the Internet?

I am using Ubuntu 14.04.2 LTS, 64-bit version.

EDIT: All three dual-boot Ubuntu 14.04 and Windows 7 though I have not booted any of them in Windows in several weeks/months. I set these machines up several months ago so I am not certain but I intended that they all be set to use UTC time (following this link to make sure Windows cooperates). I just opened /etc/default/rcS on the laptop and one of the desktops and they both have UTC=no set so that seems not to be the case. Looking at the system time on the laptop I get:

>>> sudo hwclock --show
Wed 11 Mar 2015 06:33:13 AM EDT  -0.188065 seconds

while for one of the desktops I get:

>>> sudo hwclock --show
Wed 11 Mar 2015 11:32:56 AM EDT  -0.219271 seconds

and it is just after 11:30 AM EDT (3:30 PM UTC) as I type this. Comparing those results, it seems the the desktop is on local time while I don't know what the laptop is on as EST = UTC - 5 and EDT = UTC - 4.

How would I update each system to in fact be on UTC time (I intend to follow this to make sure Windows does not change things)?

  • 1
    I have report bugs about this here: bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/… and here: bugs.launchpad.net/ubuntu/+source/systemd/+bug/1420659 --- @wie5ooma answer is correct, but I still think this is a user interface bug. – Rmano Mar 12 '15 at 13:52
  • I am not sure how one of my computers had ntp installed while the other did not. I did not install it myself. – Steven C. Howell Mar 12 '15 at 13:55
  • Yes --- this is the problem. I think that "use network time" should always install ntp --- at least, this is the expected behavior in my opnion. I reported it only against gnome-control-center, didn't test in unity-control-center; if you can confirm the problem, please report it. – Rmano Mar 12 '15 at 13:56
7

See if you have a file /etc/ntp.conf, then see if this file contains line starting with the keyword 'server' (without the quotes of course). If you have this then the time will be regularly synchronized with timeservers.

If you do not have this file then no time keeping service is installed. To install ntpd, from a terminal prompt enter:

sudo apt-get install ntp

That is about it in a nutshell. If you do not have this file or if you are not sure what about what you are doing please refer to this resource: https://help.ubuntu.com/lts/serverguide/NTP.html. It contains more useful information than I can explain here. Although it is about servers it works equally good for desktops and laptops.

To modify the systems to use UTC time, edit /etc/default/rcS (e.g. sudo emacs /etc/default/rcS) setting UTC=yes.

  • This file exists on at least one of my desktops but not on the laptop (why would that be?). It has these servers listed: server 0.ubuntu.pool.ntp.org, server 1.ubuntu.pool.ntp.org, server 2.ubuntu.pool.ntp.org, server 3.ubuntu.pool.ntp.org, and server ntp.ubuntu.com. Is there anything wrong with copying that file straight across (duplicating the ownership and permissions of course)? – Steven C. Howell Mar 11 '15 at 16:35
  • 1
    This looks pretty normal to me, so that's good. The laptop without the specified file has no time keeping service installed yet. Issue the install command mentioned in my answer above and you should be good. – wie5Ooma Mar 11 '15 at 21:42
  • You were correct, I verified the desktop had ntp installed and the laptop did not. To make sure both were using UTC time, I modified /etc/default/rcS setting UTC=yes. I installed ntp, set the clock time to an incorrect time in the bios, booted Ubuntu, then verified the clock time was correctly set to UTC time using sudo hwclock --show then also from the bios. – Steven C. Howell Mar 12 '15 at 13:46
1

From response #7 on this post I found that I could run the command sudo ntpdate pool.ntp.org which would force the machine to sync the time. This seems to have corrected the time displayed but I am not sure the effect on the system time or if it will remain after rebooting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.