Advertisement

How to set time from the Internet (NTP) in Linux Mint 17

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.

Advertisеment


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:
Linux Mint install ntpdate
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.

  1. Go to Menu -> Preferences - Date & Time.Linux Mint cinnamon date and time
  2. The Date and Time applet will appear on the screen.
  3. Click the button "Unlock" and turn on the option Network Time:Cinnamon unlock date optionsCinnamon sync date 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.MATE ntp request

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.

  1. Open your favorite terminal app. Any app is suitable.
  2. Type the following command:
    sudo crontab -e

    Enter your password to confirm the command.Linux Mint crontab 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.

  3. 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.Linux Mint sync date time ntp MATE XFCE
    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.

  4. Press Ctrl + O to save the changes you make.save task
  5. Now, exit your editor app. In case of nano, press Ctrl + X:activate task
    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.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.