更新配置文件创建方法

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
+11 -11
View File
@@ -36,7 +36,7 @@ Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
```bash
## 配置 PVE 系统默认软件源脚本
$ cat > /etc/apt/sources.list.d/debian.sources <<EOF
$ tee /etc/apt/sources.list.d/debian.sources >/dev/null <<'EOF'
Types: deb
URIs: https://mirrors.ustc.edu.cn/debian
Suites: trixie trixie-updates
@@ -48,9 +48,7 @@ URIs: https://mirrors.ustc.edu.cn/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
```
### 1.2. PVE 软件源
@@ -61,15 +59,13 @@ EOF
```bash
## 配置 PVE 系统免订阅软件源脚本
$ cat > /etc/apt/sources.list.d/pve-no-subscription.sources <<EOF
$ tee /etc/apt/sources.list.d/pve-no-subscription.sources >/dev/null <<'EOF'
Types: deb
URIs: https://mirrors.ustc.edu.cn/proxmox/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF
```
对于 Proxmox Backup Server 和 Proxmox Mail Gateway,请将以上命令路径中的 `pve` 分别替换为 `pbs``pmg`
@@ -79,18 +75,22 @@ EOF
```bash
## 配置 PVE Ceph 免订阅软件源脚本
$ if [ -f /etc/apt/sources.list.d/ceph.sources ]; then
CEPH_CODENAME=`ceph -v | grep ceph | awk '{print $(NF-1)}'`
source /etc/os-release
cat > /etc/apt/sources.list.d/pve-ceph-no-subscription.sources <<EOF
. /etc/os-release
CEPH_CODENAME=$(ceph -v | awk '/^ceph version / { print $(NF - 1); exit }')
if [ -z "$CEPH_CODENAME" ] || [ -z "${VERSION_CODENAME:-}" ]; then
echo "无法确定 Ceph 或 Debian 版本代号。" >&2
exit 1
fi
tee /etc/apt/sources.list.d/pve-ceph-no-subscription.sources >/dev/null <<EOF
Types: deb
URIs: https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME
Suites: $VERSION_CODENAME
Components: no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF
fi
```
最后,删除 PVE 官方付费软件源,执行以下命令。