替换apt软件源
替换前建议先更新下证书,否则可能由于证书不可用导致 https 无法使用,进而无法下载所有软件。
apt install apt-transport-https ca-certificates
首先替换通用软件源, Debian的软件源配置文件是/etc/apt/sources.list
,备份后将其中内容修改为以下即可。
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
之后替换PVE软件源,PVE镜像默认的PVE软件源配置文件是/etc/apt/sources.list.d/pve-enterprise.list
,备份后将其中内容替换为以下即可:
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription
最后更新下,速度很快:
apt update
修改CT Templates(LXC容器)源
将/usr/share/perl5/PVE/APLInfo.pm
文件中默认的源地址http://download.proxmox.com
替换为https://mirrors.tuna.tsinghua.edu.cn/proxmox
即可。
可以使用如下命令修改:
cp /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm.bak
sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
针对/usr/share/perl5/PVE/APLInfo.pm
文件的修改,重启后生效。
systemctl restart pvedaemon.service
之后在PVE网页端下载CT Templates速度就很快了。
来源:https://www.frytea.com/archives/605/