15

I have a Bash script who update the time of my mac but since the update of Mojave the command isn't found:

ntpdate -u time.apple.com

return :

ntpdate: command not found

Where am I going wrong?

Louis Brahmi
  • 834
  • 2
  • 9
  • 21

2 Answers2

56

It's a duplicate. Please check this stackoverflow question.

TL;DR use sudo sntp -sS time.apple.com instead.

Mike
  • 731
  • 1
  • 8
  • 10
1

For anyone trying to do this because their vm cannot connect to the update server while trying to install macos on a virtual machine, I switched my network adapter from NAT to bridged and the issue was resolved.

Josh Woodcock
  • 2,683
  • 1
  • 22
  • 29
  • You saved my life! If you're on VMWare fusion and installing Mojave, changed your network adapter to "Bridged Networking -> Autodetect" – joke4me Apr 08 '21 at 08:03