mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-08-31 22:12:51 +08:00
更新 PVE 制作虚拟机模板
This commit is contained in:
@@ -60,8 +60,11 @@ cd /etc/apt/
|
|||||||
## 查看镜像配置文件
|
## 查看镜像配置文件
|
||||||
cat sources.list
|
cat sources.list
|
||||||
|
|
||||||
|
|
||||||
## 配置文件输出
|
## 配置文件输出
|
||||||
|
|
||||||
# See /etc/apt/sources.list.d/debian.sources
|
# See /etc/apt/sources.list.d/debian.sources
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
进一步查看新配置文件 `debian.sources` 的内容,其配置包含 `3` 个部分。
|
进一步查看新配置文件 `debian.sources` 的内容,其配置包含 `3` 个部分。
|
||||||
@@ -70,7 +73,9 @@ cat sources.list
|
|||||||
## 查看新版镜像配置文件
|
## 查看新版镜像配置文件
|
||||||
cat /etc/apt/sources.list.d/debian.sources
|
cat /etc/apt/sources.list.d/debian.sources
|
||||||
|
|
||||||
|
|
||||||
## 新版配置文件输出 (主体部分)
|
## 新版配置文件输出 (主体部分)
|
||||||
|
|
||||||
Types: deb deb-src
|
Types: deb deb-src
|
||||||
URIs: mirror+file:///etc/apt/mirrors/debian.list
|
URIs: mirror+file:///etc/apt/mirrors/debian.list
|
||||||
Suites: bookworm bookworm-updates bookworm-backports
|
Suites: bookworm bookworm-updates bookworm-backports
|
||||||
@@ -81,17 +86,24 @@ URIs: mirror+file:///etc/apt/mirrors/debian-security.list
|
|||||||
Suites: bookworm-security
|
Suites: bookworm-security
|
||||||
Components: main
|
Components: main
|
||||||
|
|
||||||
|
|
||||||
## 查看关联的配置文件
|
## 查看关联的配置文件
|
||||||
cat /etc/apt/mirrors/debian.list
|
cat /etc/apt/mirrors/debian.list
|
||||||
|
|
||||||
|
|
||||||
## 关联配置文件输出 (关联部分 1 )
|
## 关联配置文件输出 (关联部分 1 )
|
||||||
|
|
||||||
https://deb.debian.org/debian
|
https://deb.debian.org/debian
|
||||||
|
|
||||||
|
|
||||||
## 查看关联的配置文件
|
## 查看关联的配置文件
|
||||||
cat /etc/apt/mirrors/debian-security.list
|
cat /etc/apt/mirrors/debian-security.list
|
||||||
|
|
||||||
|
|
||||||
## 关联配置文件输出 (关联部分 2 )
|
## 关联配置文件输出 (关联部分 2 )
|
||||||
|
|
||||||
https://deb.debian.org/debian-security
|
https://deb.debian.org/debian-security
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
因此,修改 Debian12 软件源的方式也有两种,本文将尝试使用第 `2` 种修改方案。
|
因此,修改 Debian12 软件源的方式也有两种,本文将尝试使用第 `2` 种修改方案。
|
||||||
@@ -130,8 +142,11 @@ Components: main contrib non-free non-free-firmware
|
|||||||
## 编辑 debian.list 配置文件
|
## 编辑 debian.list 配置文件
|
||||||
sudo vim /etc/apt/mirrors/debian.list
|
sudo vim /etc/apt/mirrors/debian.list
|
||||||
|
|
||||||
|
|
||||||
## 替换为 USTC 地址
|
## 替换为 USTC 地址
|
||||||
|
|
||||||
http://mirrors.ustc.edu.cn/debian
|
http://mirrors.ustc.edu.cn/debian
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
使用 `vim` 编辑器编辑 `debian-security.list` 中镜像源地址,并保存。
|
使用 `vim` 编辑器编辑 `debian-security.list` 中镜像源地址,并保存。
|
||||||
@@ -140,8 +155,11 @@ http://mirrors.ustc.edu.cn/debian
|
|||||||
## 编辑 debian-security.list 配置文件
|
## 编辑 debian-security.list 配置文件
|
||||||
sudo vim /etc/apt/mirrors/debian-security.list
|
sudo vim /etc/apt/mirrors/debian-security.list
|
||||||
|
|
||||||
|
|
||||||
## 替换为 USTC 地址
|
## 替换为 USTC 地址
|
||||||
|
|
||||||
http://mirrors.ustc.edu.cn/debian-security
|
http://mirrors.ustc.edu.cn/debian-security
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.3.安装软件
|
### 1.3.安装软件
|
||||||
@@ -233,8 +251,11 @@ sudo timedatectl set-timezone Asia/Shanghai
|
|||||||
## 检查系统时间
|
## 检查系统时间
|
||||||
date -R
|
date -R
|
||||||
|
|
||||||
|
|
||||||
## 参考输出
|
## 参考输出
|
||||||
|
|
||||||
Mon, 26 Jun 2023 16:16:16 +0800
|
Mon, 26 Jun 2023 16:16:16 +0800
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Debian 云镜像默认使用 `systemd-timesyncd.service` 同步时间,且需要调整为使用国内 NTP 服务器。
|
Debian 云镜像默认使用 `systemd-timesyncd.service` 同步时间,且需要调整为使用国内 NTP 服务器。
|
||||||
@@ -311,8 +332,12 @@ sudo systemctl status apt-daily-upgrade.timer
|
|||||||
sudo dpkg-reconfigure -plow unattended-upgrades
|
sudo dpkg-reconfigure -plow unattended-upgrades
|
||||||
|
|
||||||
## 选择 “是” (“YES”)
|
## 选择 “是” (“YES”)
|
||||||
|
|
||||||
|
|
||||||
## 示例输出
|
## 示例输出
|
||||||
|
|
||||||
Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version
|
Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
接下来调整 apt 的 `20auto-upgrades` 配置文件。
|
接下来调整 apt 的 `20auto-upgrades` 配置文件。
|
||||||
@@ -411,8 +436,11 @@ sudo crontab -l
|
|||||||
## 编辑系统定时任务,编辑器选择 nano
|
## 编辑系统定时任务,编辑器选择 nano
|
||||||
sudo crontab -e
|
sudo crontab -e
|
||||||
|
|
||||||
|
|
||||||
## 在配置文件末尾增加以下配置项
|
## 在配置文件末尾增加以下配置项
|
||||||
|
|
||||||
0 6 8,24 * * /usr/sbin/reboot
|
0 6 8,24 * * /usr/sbin/reboot
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.8.配置 ZSH
|
### 1.8.配置 ZSH
|
||||||
|
|||||||
Reference in New Issue
Block a user