更新配置文件创建方法

This commit is contained in:
CallMeR
2026-08-14 00:55:51 +08:00
parent 14595919e4
commit e37d437f0f
6 changed files with 64 additions and 155 deletions
+10 -29
View File
@@ -31,11 +31,9 @@ update-alternatives: using /usr/bin/nvim to provide /usr/bin/editor (editor) in
$ mkdir -p /etc/xdg/nvim
## 配置 nvim 鼠标交互行为脚本
$ tee /etc/xdg/nvim/sysinit.vim << 'EOF'
$ tee /etc/xdg/nvim/sysinit.vim >/dev/null <<'EOF'
set mouse=
EOF
```
## 1.系统时区
@@ -79,7 +77,7 @@ pool cn.pool.ntp.org iburst
```
保存该配置文件后,需重启 `chrony.service` ,并再次检查系统 NTP 服务器地址。
配置文件编辑完成后,需重启 `chrony.service` ,并再次检查系统 NTP 服务器地址。
```bash
## 重启 chrony.service
@@ -173,18 +171,13 @@ performance powersave
```bash
## 创建 cpupower 默认配置文件
$ editor /etc/default/cpupower
```
在配置文件中输入以下内容,并保存。
```bash
$ tee /etc/default/cpupower >/dev/null <<'EOF'
# This configuration file is customized by fox,
# Optimize system CPU governors.
# Optimize CPU governor settings.
CPUPOWER_START_OPTS="frequency-set -g powersave"
CPUPOWER_STOP_OPTS="frequency-set -g performance"
EOF
```
进一步创建 `cpupower` 服务配置文件,以满足系统自动化设置需求。
@@ -293,23 +286,16 @@ $ dpkg-reconfigure -plow unattended-upgrades
开始调整 `20auto-upgrades` 配置文件。
```bash
## 编辑 20auto-upgrades 配置文件
$ editor /etc/apt/apt.conf.d/20auto-upgrades
```
清空当前全部配置项后,输入以下内容,并保存。
配置文件中,用来控制更新周期的参数为 `APT::Periodic::Unattended-Upgrade` `10` 表示更新周期为 `10` 天。
```bash
## 系统更新周期配置项
## 编辑 20auto-upgrades 配置文件
$ tee /etc/apt/apt.conf.d/20auto-upgrades >/dev/null <<'EOF'
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "10";
APT::Periodic::AutocleanInterval "1";
APT::Periodic::CleanInterval "1";
EOF
```
进一步调整 `50unattended-upgrades` 配置文件。
@@ -461,19 +447,14 @@ $ update-grub
```bash
## 编辑系统配置文件
$ editor /etc/modules-load.d/10-server-modules.conf
```
在配置文件中输入以下内容,并保存。
```bash
$ tee /etc/modules-load.d/10-server-modules.conf >/dev/null <<'EOF'
# This configuration file is customized by fox,
# Optimize vfio related modules at system boot.
vfio
vfio_iommu_type1
vfio_pci
EOF
```
执行以下命令更新 `initramfs` ,更新完成后,建议重启 PVE 服务器。