mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-09-01 14:32:53 +08:00
更新配置文件创建方法
This commit is contained in:
+11
-11
@@ -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 官方付费软件源,执行以下命令。
|
||||
|
||||
Reference in New Issue
Block a user