If you want to be sure that the time on your Linux Mint PC is accurate, you might want to set it to update automatically from special time servers on the Internet. To do this, you need to configure the Linux Mint operating system properly. Here is how it can be done.
First, you need to install the ntpdate package. Open Menu -> Settings -> Software manager and look for this package. You can use search to save your time. In the screenshot below, I have it installed:
If your setup does not have it, then install the ntpdate package.
"ntpdate" is a lightweight package which can be used to obtain time from the Internet using NTP (network time protocol).
The next step depends on the desktop environment you are using in Linux Mint.
How to set time from the Internet with Cinnamon
This is pretty easy. If you have the ntpdate package installed, all you need to do is turn on the appropriate setting in System Settings (Control Center).
Do it as follows.
- Go to Menu -> Preferences - Date & Time.
- The Date and Time applet will appear on the screen.
- Click the button "Unlock" and turn on the option Network Time:
Under the hood of this GUI, Cinnamon is using the mentioned ntpdate via the following command:
/usr/sbin/ntpdate -s ntp.ubuntu.com
It uses the default NTP server of Ubuntu.
How to set time from the Internet with MATE and XFCE
Unlike Cinnamon, other desktop environments offer a different way to sync time via NTP or do not have a GUI at all.
Two other popular desktop environments for Linux Mint are MATE and XFCE.
While MATE comes with an option to sync time and date with Internet servers, it requires another package, ntp, which is a full featured NTP server.
This is an overkill for the typical home user, so I would like to avoid it. There is no reason to run your own NTP server on your home PC or laptop.
The tutorial below is applicable to both of them and can be used in any DE, even without an X server. Here is how it can be done.
- Open your favorite terminal app. Any app is suitable.
- Type the following command:
sudo crontab -e
Enter your password to confirm the command.
If you do this for the first time, you will be offered to select the default editor. nano will be selected by default. You can accept it.
This will allow you to schedule tasks via the cron task scheduler which comes pre-installed.
- In the editor session, which in my case is nano, you need to add a new line to the opened file. Type the line as follows:
0 */2 * * * /usr/sbin/ntpdate -s ntp.ubuntu.com
This will run the ntpdate command every 2 hours, which is enough to keep the software clock accurate.
An additional advantage of this method is that you get the ability to change the NTP server to any desired value instead of the default ntp.ubuntu.com.
- Press Ctrl + O to save the changes you make.
- Now, exit your editor app. In case of nano, press Ctrl + X:
This will activate the task you just added.
That's it. Now your time will be synchronized with the NTP server of your choice and your Linux Mint PC will always have its time and date accurate.
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options: