Ubuntu – How to change the time server in ubuntu 12.04 LTS without installing the `ntp` package

ntp

I am on Ubuntu 12.04 LTS, in the dialog "Time and Date settings" there is a set of radio buttons labeled as "Set the time", the two options are "Manually" and "Automatically from the Internet":

enter image description here

My current selection is "Automatically from the Internet" and I am fine with that apart from the fact that I would like to change the synchronization server (I would like to set it to ntp1.inrim.it). Is it possible without installing the ntp package? I did not find any way to change the server from the dialog.

Best Answer

There are two main ways to set the current time via NTP: ntpdate is a command-line tool that, when run, fetches the current time from an NTP server and sets the system time accordingly. ntpd is the NTP daemon which runs in the background and continuously adjusts the time slightly.

For servers, production environments and such, ntpd is better. However, for normal desktop PCs and end users, ntpdate is perfectly fine. In fact, when you install Ubuntu Desktop, it comes with ntpdate preinstalled, but not ntpd.

When you select "Automatically from the Internet" in your Ubuntu system settings as shown in your screenshot above, what happens is that at each boot Ubuntu will fetch the current time using ntpdate from ntp.ubuntu.com. If you want to change that server, you can edit the value of NTPSERVERS in /etc/default/ntpdate.

The alternative is to install ntpd (in package ntp), and configure that via /etc/ntp.conf. This is explained here in more detail:

https://help.ubuntu.com/lts/serverguide/NTP.html

However, if you do not want to install any additional packages and simply change the default server for ntpdate which comes pre-installed with Ubuntu, simply edit /etc/default/ntpdate.