February 24, 2010

Syncing Ubuntu System Time With Network Time

Try one of the following to sync your system time with the network time.

1. Check whether your system date and time are correct. If not, set the correct date and time.

2. You can also try System-> Administration-> Time and Date.

i) Unlock.

ii) Select Keep synchronized with Internet servers.

iii) If you are asked to install NTP support, click Install NTP support.

iv) Click Select Servers, and check required servers, or add a new one by typing URL of the server in the textbox clicking the Add button.

3. Please refer to the post Removing SSL Certificate Error In Ubuntu.

Removing SSL Certificate Expiry Error In Ubuntu

SSL certificate error for any site shows up when your system time is not in sync with the network time. If you view the details, you'll find that the date shown is in the past. To sync your system time, you can use ntpdate.

1. If it is not already installed, install it first.

varsha@varsha-laptop:~$ sudo apt-get install ntpdate

2. If it is already installed, try syncing the time.

varsha@varsha-laptop:~$ sudo /etc/network/if-up.d/ntpdate


varsha@varsha-laptop:~$ sudo ntpdate ntp.ubuntu.com

3. Try editing the ntpdate file.

varsha@varsha-laptop:~$ sudo gedit /etc/default/ntpdate

The file looks like:

# servers to check. (Separate multiple servers with spaces.)
NTPSERVERS=”0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org”
# additional options for ntpdate

If you have your own NTP server, list it under NTPSERVERS.

Save and exit the editor.

4. Now, use cronjob to run ntpdate every hour.

varsha@varsha-laptop:~$ crontab -e

In the file, type the following.

@hourly /etc/network/if-up.d/ntpdate

Save and exit. See the options at the bottom of the terminal for help.

5. Try updating again.

varsha@varsha-laptop:~$ sudo /etc/network/if-up.d/ntpdate

Try opening any site. You will at least get the option of adding an exception.


1. http://www.askdavetaylor.com/invalid_or_expired_security_certificate.html

2. http://www.ubuntugeek.com/keeping-your-system-clock-current-automatically-via-network-time-protocol-ntp.html

3. http://www.cyberciti.biz/faq/set-date-time-network-time-protocol-ntp/

4. http://www.howtogeek.com/howto/ubuntu/sync-your-system-clock-with-internet-time-servers-in-ubuntu/ (for Ubuntu 8.10)