mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-08-31 05:52:52 +08:00
更新 PVE 软件源替换命令
This commit is contained in:
+31
-21
@@ -64,27 +64,37 @@ deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib
|
||||
|
||||
默认情况下,PVE 额外启用了 2 个官方源,且为订阅收费制,因此需要替换为免费源。
|
||||
|
||||
删除 PVE 官方付费软件源,执行以下命令。
|
||||
首先创建 PVE 免费软件源,执行以下命令。
|
||||
|
||||
```bash
|
||||
## 创建 PVE 免费软件源
|
||||
|
||||
$ source /etc/os-release
|
||||
|
||||
$ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve $VERSION_CODENAME pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
|
||||
```
|
||||
|
||||
对于 Proxmox Backup Server 和 Proxmox Mail Gateway,请将以上命令中的 `pve` 分别替换为 `pbs` 和 `pmg` 。
|
||||
|
||||
进一步创建 PVE Ceph 免费软件源,Ceph 软件源为 PVE 8 之后默认安装,执行以下命令。
|
||||
|
||||
```bash
|
||||
## 创建 PVE Ceph 免费软件源脚本
|
||||
|
||||
if [ -f /etc/apt/sources.list.d/ceph.list ]; 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
|
||||
fi
|
||||
```
|
||||
|
||||
最后,删除 PVE 官方付费软件源,执行以下命令。
|
||||
|
||||
**注意:rm 为高风险命令,请正确使用,请勿手抖,请勿手抖。**
|
||||
|
||||
```bash
|
||||
## 删除付费软件源
|
||||
$ rm -rvf /etc/apt/sources.list.d/*.list
|
||||
```
|
||||
|
||||
创建 PVE 免费软件源。
|
||||
|
||||
**注意:该命令为三行,在输入时请逐行输入并回车执行。**
|
||||
|
||||
```bash
|
||||
## 创建 PVE 免费源
|
||||
|
||||
$ source /etc/os-release
|
||||
|
||||
$ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy $VERSION_CODENAME no-subscription" > /etc/apt/sources.list.d/ceph-no-subscription.list
|
||||
|
||||
$ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve $VERSION_CODENAME pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
|
||||
$ rm -rvf /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/ceph.list
|
||||
```
|
||||
|
||||
创建完成后对其进行检查。
|
||||
@@ -92,9 +102,9 @@ $ echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve $VERSION_CODENAME pve
|
||||
```bash
|
||||
## 检查 PVE 免费源
|
||||
|
||||
$ cat /etc/apt/sources.list.d/ceph-no-subscription.list
|
||||
|
||||
$ cat /etc/apt/sources.list.d/pve-no-subscription.list
|
||||
|
||||
$ cat /etc/apt/sources.list.d/ceph-no-subscription.list
|
||||
```
|
||||
|
||||
如果输出结果中有 USTC 的镜像地址,则表示命令已经正确执行。
|
||||
@@ -102,11 +112,11 @@ $ cat /etc/apt/sources.list.d/pve-no-subscription.list
|
||||
```bash
|
||||
#### PVE 免费软件源示例输出
|
||||
|
||||
#### Ceph
|
||||
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription
|
||||
|
||||
#### PVE
|
||||
deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription
|
||||
|
||||
#### Ceph
|
||||
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription
|
||||
```
|
||||
|
||||
### 1.3. PVE CT 源
|
||||
|
||||
Reference in New Issue
Block a user