mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-09-01 14:32:53 +08:00
更新 PVE 制作虚拟机模板
This commit is contained in:
+13
-23
@@ -111,41 +111,28 @@ $ sudo vim /etc/apt/sources.list.d/debian.sources
|
||||
## 系统软件源配置项
|
||||
|
||||
Types: deb
|
||||
URIs: mirror+file:///etc/apt/mirrors/debian.list
|
||||
URIs: https://mirrors.ustc.edu.cn/debian
|
||||
Suites: bookworm bookworm-updates bookworm-backports
|
||||
Components: main contrib non-free non-free-firmware
|
||||
|
||||
Types: deb
|
||||
URIs: mirror+file:///etc/apt/mirrors/debian-security.list
|
||||
URIs: https://mirrors.ustc.edu.cn/debian-security
|
||||
Suites: bookworm-security
|
||||
Components: main contrib non-free non-free-firmware
|
||||
|
||||
```
|
||||
|
||||
使用 `vim` 编辑器编辑 `debian.list` 中镜像源地址,并保存。
|
||||
为了防止 `Cloud-Init` 服务意外修改软件源配置,需要添加文件保护,执行以下命令。
|
||||
|
||||
```bash
|
||||
## 编辑 debian.list 配置文件
|
||||
$ sudo vim /etc/apt/mirrors/debian.list
|
||||
## 增加文件保护
|
||||
$ sudo chattr +i /etc/apt/sources.list.d/debian.sources
|
||||
|
||||
## 检查文件保护
|
||||
$ lsattr /etc/apt/sources.list.d/debian.sources
|
||||
|
||||
## 替换为 USTC 地址
|
||||
|
||||
http://mirrors.ustc.edu.cn/debian
|
||||
|
||||
```
|
||||
|
||||
使用 `vim` 编辑器编辑 `debian-security.list` 中镜像源地址,并保存。
|
||||
|
||||
```bash
|
||||
## 编辑 debian-security.list 配置文件
|
||||
$ sudo vim /etc/apt/mirrors/debian-security.list
|
||||
|
||||
|
||||
## 替换为 USTC 地址
|
||||
|
||||
http://mirrors.ustc.edu.cn/debian-security
|
||||
|
||||
#### 示例输出
|
||||
----i---------e------- /etc/apt/sources.list.d/debian.sources
|
||||
```
|
||||
|
||||
### 1.3.安装软件
|
||||
@@ -465,11 +452,14 @@ $ rm -rvf ~/.bash_history ~/.zsh_history
|
||||
|
||||
## 清理命令历史
|
||||
$ history -c
|
||||
|
||||
## 关闭系统
|
||||
$ sudo shutdown now
|
||||
```
|
||||
|
||||
## 2.虚拟机转为模板
|
||||
|
||||
将 Debian 模板虚拟机关机,并进入 PVE 的 WEB 管理界面。
|
||||
在 Debian 模板虚拟机关机后,进入 PVE 的 WEB 管理界面。
|
||||
|
||||
在左侧虚拟机列表中,鼠标 **右键单击** Debian 模板虚拟机,在弹出的菜单中选择 `转换成模板` 。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user