Ubuntu设置时区和时间同步

文章目录

Ubuntu设置时区和时间同步

一、前言

1.环境

  • LInux 发行版本:ubuntu-22.04.3-desktop-amd64.iso

Ubuntu Server:https://ubuntu.com/download/server

二、正文

1.设置时区

  • 更新本地软件包列表的索引
cmd 复制代码
sudo apt-get update
  • 设置时区
cmd 复制代码
sudo timedatectl set-timezone Asia/Shanghai

2.时间同步

  • systemd-timesyncd 状态
cmd 复制代码
timedatectl status
  • 启用 NTP 同步
cmd 复制代码
sudo timedatectl set-ntp true
  • 配置同步服务器
cmd 复制代码
sudo nano /etc/systemd/timesyncd.conf

写入内容

cmd 复制代码
[Time]
NTP=time.windows.com
FallbackNTP=ntp.ubuntu.com
  • 重启服务
cmd 复制代码
sudo systemctl restart systemd-timesyncd
相关推荐
Karoku06625 分钟前
【CI/CD】CI/CD环境搭建流程和持续集成环境配置
运维·ci/cd·docker·容器·kubernetes·prometheus
Nerd Nirvana2 小时前
软考—系统架构设计(案例 | 论文)
linux·系统架构·软件工程·软考·计算机基础
勤奋的凯尔森同学3 小时前
webmin配置终端显示样式,模仿UbuntuDesktop终端
linux·运维·服务器·ubuntu·webmin
月光水岸New4 小时前
Ubuntu 中建的mysql数据库使用Navicat for MySQL连接不上
数据库·mysql·ubuntu
莫忘初心丶4 小时前
在 Ubuntu 22 上使用 Gunicorn 启动 Flask 应用程序
python·ubuntu·flask·gunicorn
技术小齐8 小时前
网络运维学习笔记 016网工初级(HCIA-Datacom与CCNA-EI)PPP点对点协议和PPPoE以太网上的点对点协议(此处只讲华为)
运维·网络·学习
ITPUB-微风8 小时前
Service Mesh在爱奇艺的落地实践:架构、运维与扩展
运维·架构·service_mesh
打不了嗝 ᥬ᭄8 小时前
Linux的权限
linux
落幕8 小时前
C语言-进程
linux·运维·服务器
深度Linux8 小时前
C++程序员内功修炼——Linux C/C++编程技术汇总
linux·项目实战·c/c++