Archived
update 5.PVE配置模板虚拟机.md.
This commit is contained in:
+64
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
此时可以将 Debian 模板虚拟机开机,并使用 `Cloud-Init` 中设置的账号密码进行登录。
|
||||
|
||||
本文中的内容需要在 CLI 终端环境下输入命令,常用 SSH 工具请查阅 [SSH 工具推荐](./1.PVE系统安装.md#03ssh工具) 。
|
||||
本文中的内容需要在终端环境下输入命令,常用 SSH 工具请查阅 [SSH 工具推荐](./1.PVE系统安装.md#03ssh工具) 。
|
||||
|
||||
### 1.1.启用SSH密码登录
|
||||
|
||||
@@ -248,4 +248,67 @@ MS Name/IP address Stratum Poll Reach LastRx Last sample
|
||||
===============================================================================
|
||||
^+ 139.199.215.251 2 10 177 244 -1669us[-1757us] +/- 67ms
|
||||
^* 203.107.6.88 2 10 377 105 -1005us[-1094us] +/- 19ms
|
||||
```
|
||||
|
||||
### 1.6.配置系统自动更新
|
||||
|
||||
配置 Debian 模板虚拟机的系统自动更新,与配置 PVE 系统自动更新方法基本一致,参考 [PVE系统自动更新](./3.PVE系统调整.md#5pve系统自动更新) 。
|
||||
|
||||
配置系统更新之前,先检查当前系统定时器状态:
|
||||
|
||||
```bash
|
||||
## 检查系统定时器
|
||||
sudo systemctl status apt-daily-upgrade.timer
|
||||
```
|
||||
|
||||
配置系统自动更新策略,执行以下命令:
|
||||
|
||||
```bash
|
||||
## 配置自动更新策略
|
||||
sudo dpkg-reconfigure -plow unattended-upgrades
|
||||
|
||||
## 选择 “是” (“YES”)
|
||||
## 示例输出
|
||||
Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version
|
||||
```
|
||||
|
||||
执行命令后,使用键盘 `方向键` 进行选择,`回车` 键进行确认。
|
||||
|
||||
接下来调整 apt 的 `20auto-upgrades` 配置文件:
|
||||
|
||||
```bash
|
||||
## 进入 apt 的配置目录
|
||||
cd /etc/apt/apt.conf.d
|
||||
|
||||
## 编辑 20auto-upgrades 配置文件
|
||||
sudo nano 20auto-upgrades
|
||||
|
||||
## 删除里面全部内容并填写以下内容
|
||||
APT::Periodic::Update-Package-Lists "1";
|
||||
APT::Periodic::Unattended-Upgrade "1";
|
||||
APT::Periodic::AutocleanInterval "1";
|
||||
APT::Periodic::CleanInterval "1";
|
||||
```
|
||||
|
||||
再调整 apt 的 `50unattended-upgrades` 配置文件,所有修改项目汇聚如下:
|
||||
|
||||
```bash
|
||||
## 编辑 50unattended-upgrades 配置文件
|
||||
sudo nano 50unattended-upgrades
|
||||
|
||||
## 取消了以下行前面的注释,代表启用
|
||||
"origin=Debian,codename=${distro_codename}-updates";
|
||||
|
||||
## 取消以下行的前面注释,代表启用,并调整参数
|
||||
Unattended-Upgrade::AutoFixInterruptedDpkg "true";
|
||||
|
||||
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
|
||||
|
||||
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
|
||||
|
||||
Unattended-Upgrade::Remove-Unused-Dependencies "true";
|
||||
|
||||
Unattended-Upgrade::Automatic-Reboot "true";
|
||||
|
||||
Unattended-Upgrade::Automatic-Reboot-Time "04:30";
|
||||
```
|
||||
Reference in New Issue
Block a user