Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ZamanOof/09df55b88164d730a0d5240b92dbaa4d to your computer and use it in GitHub Desktop.
Save ZamanOof/09df55b88164d730a0d5240b92dbaa4d to your computer and use it in GitHub Desktop.
update your system using alternative ways

update date and time using http protocol

using curl to update date and time

sudo date -s "$(curl -H'Cache-Control:no-cache' -sI google.com | grep '^Date:' | cut -d' ' -f3-6)Z"

using wget to update date and time of linux/server

sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"

using htpdate

apt install htpdate

usage

htpdate -D -u nobody:nogroup www.linux.org www.freebsd.org

for more https://linux.die.net/man/8/htpdate

using tlsdate

sudo tlsdate -V

More https://github.com/ioerror/tlsdate

another script

https://gist.github.com/jaytaylor/60c8a4e22431c4271200cab68186deb7

More

  1. https://askubuntu.com/questions/429306/ntpdate-no-server-suitable-for-synchronization-found
  2. https://superuser.com/questions/307158/how-to-use-ntpdate-behind-a-proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment