PVE 修改软件源
风铃_Ring
编辑于 2022年10月08日 17:23
收录于文集
共3篇

视频教学:PVE 修改软件源​

PVE 默认的软件源是用的国外服务器,所以我们的环境下进行软件更新、安装的时候都会比较慢。现在国内已经有许多的镜像仓库供我们使用。

删除 PVE 自己的软件源

PVE 本身也有自己的软件软,但是都是收费的。我们需要将其删除,不然在软件安装时会提示一些 401 的认证错误

代码块
Shell
自动换行
复制代码
rm -rf /etc/apt/sources.list.d/pve-enterprise.list
复制成功

修改软件源

  • 以防错误操作,我们先将文件进行备份

代码块
Shell
自动换行
复制代码
cp /etc/apt/sources.list /etc/apt/sources.list.bak
复制成功
  • 编辑默认软件源文件 

代码块
Shell
自动换行
复制代码
nano /etc/apt/sources.list
复制成功
  • 我们将默认的连接前面加上 # 号进行注释,或者删除这些连接

  • 添加国内软件源

    • 清华源

代码块
Shell
自动换行
复制代码
deb 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 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 https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription
复制成功
  • 中科大源

代码块
Shell
自动换行
复制代码
deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security bullseye-security main contrib 
deb https://mirrors.ustc.edu.cn/proxmox/debian bullseye pve-no-subscription
复制成功
  • 选择以上其中一个粘贴到 /etc/apt/sources.list 文件中就想下面这样

粘贴完成后按 ctrl + x

会提示是否保存,我们输入(不区分大小写) y 进行保存

  • 更新

代码块
Shell
自动换行
复制代码
apt-get update
复制成功

可以看到就已经是使用的我们修改过后的软件源了