Today I noticed that my computer clock was running fast, meaning that Debian doesn’t come with some kind of time synchronization enabled by default. Ubuntu doesn’t exactly either, but setting your location seems to take care of it in Ubuntu.
There’s really nothing much to tell here. Debian Wiki has all the instructions lined up already.
- Type date to see current date and timedate
- Install NTPaptitude install ntp
ntpq -pto see servers you are syncing with.
dateagain to see if the time changed. You time should be synced in a next minute.
There’s nothing more to do, though I often like to take a peek at the configuration files and the man pages — the latter is typically a bit too dense unless you already know what you’re looking for. In this case, that would mean
man ntp.conf, and, most important,
nano /etc/ntp.conf (or whatever your favorite text editor is). It doesn’t look like there’s anything of particular interest, but you might want to replace some of those default Debian server pools with ones geographically closer to you. The easiest way is to check on www.pool.ntp.org, but if e.g. your ISP offers such a service it might be a good idea to use it.
In my case, Belgium didn’t have too many servers, so I made up my own mix of Belgium, the Netherlands, and Europe.
#server 0.debian.pool.ntp.org iburst #server 1.debian.pool.ntp.org iburst #server 2.debian.pool.ntp.org iburst #server 3.debian.pool.ntp.org iburst server 0.be.pool.ntp.org server 1.nl.pool.ntp.org server 2.nl.pool.ntp.org server 3.europe.pool.ntp.org
Also see how to disable the daemon on battery power. I don’t know how much of a difference that would actually make, but as the Dutch idiom goes, all small bits help.