From 264bb156ffa809bff089306cc96228fb8b6d98b6 Mon Sep 17 00:00:00 2001 From: CallMeR <9463297+callmer@user.noreply.gitee.com> Date: Mon, 11 Aug 2025 01:19:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20PVE=20=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E6=BA=90=E9=85=8D=E7=BD=AE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 02.PVE初始化配置.md | 99 ++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/02.PVE初始化配置.md b/02.PVE初始化配置.md index f1b0c1c..664ed75 100644 --- a/02.PVE初始化配置.md +++ b/02.PVE初始化配置.md @@ -16,76 +16,90 @@ ```bash ## 进入系统软件源配置目录 -$ cd /etc/apt +$ cd /etc/apt/sources.list.d ## 查看系统默认镜像配置 -$ cat sources.list - -## 将默认软件源配置文件进行备份 -$ cp sources.list sources.list.bak +$ cat debian.sources ``` 系统默认镜像配置记录如下。 ```bash -deb http://ftp.debian.org/debian bookworm main contrib +Types: deb +URIs: http://deb.debian.org/debian/ +Suites: trixie trixie-updates +Components: main contrib non-free-firmware +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg -deb http://ftp.debian.org/debian bookworm-updates main contrib - -# security updates -deb http://security.debian.org bookworm-security main contrib +Types: deb +URIs: http://security.debian.org/debian-security/ +Suites: trixie-security +Components: main contrib non-free-firmware +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg ``` -这里我将使用 [中国科技大(USTC)](http://mirrors.ustc.edu.cn/help/proxmox.html) 的镜像仓库进行替换,使用如下命令。 - -**注意:该命令为两行,在输入时请逐行输入并回车执行。** +这里将使用 [中国科技大(USTC)](http://mirrors.ustc.edu.cn/help/proxmox.html) 的镜像仓库进行替换,使用如下命令。 ```bash -## 替换系统软件仓库 +## 配置 PVE 系统默认软件源脚本 -$ sed -i 's|^deb http://ftp.debian.org|deb https://mirrors.ustc.edu.cn|g' /etc/apt/sources.list +cat > /etc/apt/sources.list.d/debian.sources < /etc/apt/sources.list.d/pve-no-subscription.sources < /etc/apt/sources.list.d/pve-no-subscription.list ``` -对于 Proxmox Backup Server 和 Proxmox Mail Gateway,请将以上命令中的 `pve` 分别替换为 `pbs` 和 `pmg` 。 +对于 Proxmox Backup Server 和 Proxmox Mail Gateway,请将以上命令路径中的 `pve` 分别替换为 `pbs` 和 `pmg` 。 -进一步创建 PVE Ceph 免费软件源,Ceph 软件源为 PVE 8 之后默认安装,执行以下命令。 +进一步创建 PVE Ceph 免订阅软件源,Ceph 软件源为 PVE 8 之后默认安装,执行以下命令。 ```bash -## 创建 PVE Ceph 免费软件源脚本 +## 配置 PVE Ceph 免订阅软件源脚本 -if [ -f /etc/apt/sources.list.d/ceph.list ]; then +if [ -f /etc/apt/sources.list.d/ceph.sources ]; then CEPH_CODENAME=`ceph -v | grep ceph | awk '{print $(NF-1)}'` source /etc/os-release - echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME $VERSION_CODENAME no-subscription" > /etc/apt/sources.list.d/ceph-no-subscription.list + cat > /etc/apt/sources.list.d/ceph-no-subscription.sources <