Synchronize date and time: Difference between revisions

From WickyWiki
mNo edit summary
mNo edit summary
Line 16: Line 16:


Source:
Source:
* https://www.tecklyfe.com/fix-ubuntu-timedatectl-ntp-sync-no/
* https://help.ubuntu.com/lts/serverguide/NTP.html
* https://help.ubuntu.com/lts/serverguide/NTP.html


Line 30: Line 29:
#restart service, force update
#restart service, force update
sudo service ntp stop
sudo service ntp stop
sudo sh ntpd -gq
 
#correct the time regardless of the offset (g) and exit immediately (q)
sudo ntpd -gq
 
#start the service
sudo service ntp start
sudo service ntp start
</syntaxhighlight>
</syntaxhighlight>
Note: -gq tells the ntp daemon to correct the time regardless of the offset (g) and exit immediately (q).


See also
See also

Revision as of 19:06, 7 August 2017


timedatectl

#check settings
timedatectl

#turn sync on, it could take some minutes to sync
sudo timedatectl set-ntp true

Problem on 14.04

Source:

An Ubuntu upgrade keeps the ntpdate configuration intact and timedatectl is turned on but not synchronizing. Since ntpdate is depreciated you can manually uninstall it and replace it with ntp.

#uninstall ntpdate
sudo apt-get autoremove ntpdate

#install ntp daemon (ntpd)
sudo apt install ntp

#restart service, force update
sudo service ntp stop

#correct the time regardless of the offset (g) and exit immediately (q)
sudo ntpd -gq

#start the service
sudo service ntp start

See also

ntpdate (depreciated)

Source:

sudo ntpdate pool.ntp.org