-
Notifications
You must be signed in to change notification settings - Fork 0
/
pve_change_source.sh
29 lines (23 loc) · 1.17 KB
/
pve_change_source.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# 备份原始文件
cp /etc/apt/sources.list /etc/apt/sources.list.bak
cp /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak
cp /etc/apt/sources.list.d/ceph.list /etc/apt/sources.list.d/ceph.list.bak
# 修改 /etc/apt/sources.list
cat << EOF > /etc/apt/sources.list
deb http://mirrors4.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb http://mirrors4.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb http://mirrors4.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb http://mirrors4.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
EOF
# 修改 /etc/apt/sources.list.d/pve-enterprise.list
cat << EOF > /etc/apt/sources.list.d/pve-enterprise.list
deb http://mirrors4.tuna.tsinghua.edu.cn/proxmox/debian/pve bookworm pve-no-subscription
EOF
# 修改 /etc/apt/sources.list.d/ceph.list
cat << EOF > /etc/apt/sources.list.d/ceph.list
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription
EOF
# 更新软件包列表
apt update
echo "PVE 源已更新!"