From 2239a0f309e78f3bf27ad2eae8a403ed461e0389 Mon Sep 17 00:00:00 2001 From: CallMeR <9463297+callmer@user.noreply.gitee.com> Date: Mon, 26 Jun 2023 19:07:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20PVE=20=E5=88=B6=E4=BD=9C?= =?UTF-8?q?=E8=99=9A=E6=8B=9F=E6=9C=BA=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05.PVE制作虚拟机模板.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/05.PVE制作虚拟机模板.md b/05.PVE制作虚拟机模板.md index 62a189a..03ee6e1 100644 --- a/05.PVE制作虚拟机模板.md +++ b/05.PVE制作虚拟机模板.md @@ -60,8 +60,11 @@ cd /etc/apt/ ## 查看镜像配置文件 cat sources.list + ## 配置文件输出 + # See /etc/apt/sources.list.d/debian.sources + ``` 进一步查看新配置文件 `debian.sources` 的内容,其配置包含 `3` 个部分。 @@ -70,7 +73,9 @@ cat sources.list ## 查看新版镜像配置文件 cat /etc/apt/sources.list.d/debian.sources + ## 新版配置文件输出 (主体部分) + Types: deb deb-src URIs: mirror+file:///etc/apt/mirrors/debian.list Suites: bookworm bookworm-updates bookworm-backports @@ -81,17 +86,24 @@ URIs: mirror+file:///etc/apt/mirrors/debian-security.list Suites: bookworm-security Components: main + ## 查看关联的配置文件 cat /etc/apt/mirrors/debian.list + ## 关联配置文件输出 (关联部分 1 ) + https://deb.debian.org/debian + ## 查看关联的配置文件 cat /etc/apt/mirrors/debian-security.list + ## 关联配置文件输出 (关联部分 2 ) + https://deb.debian.org/debian-security + ``` 因此,修改 Debian12 软件源的方式也有两种,本文将尝试使用第 `2` 种修改方案。 @@ -130,8 +142,11 @@ Components: main contrib non-free non-free-firmware ## 编辑 debian.list 配置文件 sudo vim /etc/apt/mirrors/debian.list + ## 替换为 USTC 地址 + http://mirrors.ustc.edu.cn/debian + ``` 使用 `vim` 编辑器编辑 `debian-security.list` 中镜像源地址,并保存。 @@ -140,8 +155,11 @@ http://mirrors.ustc.edu.cn/debian ## 编辑 debian-security.list 配置文件 sudo vim /etc/apt/mirrors/debian-security.list + ## 替换为 USTC 地址 + http://mirrors.ustc.edu.cn/debian-security + ``` ### 1.3.安装软件 @@ -233,8 +251,11 @@ sudo timedatectl set-timezone Asia/Shanghai ## 检查系统时间 date -R + ## 参考输出 + Mon, 26 Jun 2023 16:16:16 +0800 + ``` Debian 云镜像默认使用 `systemd-timesyncd.service` 同步时间,且需要调整为使用国内 NTP 服务器。 @@ -311,8 +332,12 @@ sudo systemctl status apt-daily-upgrade.timer sudo dpkg-reconfigure -plow unattended-upgrades ## 选择 “是” (“YES”) + + ## 示例输出 + Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version + ``` 接下来调整 apt 的 `20auto-upgrades` 配置文件。 @@ -411,8 +436,11 @@ sudo crontab -l ## 编辑系统定时任务,编辑器选择 nano sudo crontab -e + ## 在配置文件末尾增加以下配置项 + 0 6 8,24 * * /usr/sbin/reboot + ``` ### 1.8.配置 ZSH