在linux上设置编码、地区、时区和NTP服务器以同步时间

90 阅读1分钟

在这个例子中,我们将设置服务器编码、地域、时区和NTP服务器,以便与我们所在的国家保持一致。我是在英国!

设置

语言和编码

$ sed -i "s/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/g" /etc/locale.gen

时区

$ timedatectl set-timezone Europe/London

ntp

# Instal

如果你需要重新启动ntp,请运行$ systemctl restart ntp 命令。

状态

蝶变

$ timedatectl
$ locale

乌班图

$ timedatectl
$ locale