bash 在 MacOS Mojave 中找不到 ntpdate 命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52548093/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 17:01:32  来源:igfitidea点击:

ntpdate command not found in MacOS Mojave

bashmacosmacos-mojave

提问by El-Burritos

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

我有一个 Bash 脚本来更新我的 mac 时间,但是由于 Majove 的更新,没有找到命令:

ntpdate -u time.apple.com

return :

返回 :

ntpdate: command not found

Where am I going wrong?

我哪里错了?

回答by user3763750

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

这是一个副本。请检查这个 stackoverflow 问题

TL;DR use sudo sntp -sS time.apple.cominstead.

TL; DR 使用sudo sntp -sS time.apple.com

回答by Josh Woodcock

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.

对于尝试这样做的任何人,因为他们的虚拟机在尝试在虚拟机上安装 macos 时无法连接到更新服务器,我将我的网络适配器从 NAT 切换到桥接,问题得到了解决。