From 73b7181c2b417f94edd67972e9260661df08795d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E5=88=80=E7=8B=90=E7=8B=B8?= Date: Wed, 20 Jul 2022 04:59:44 +0000 Subject: [PATCH] =?UTF-8?q?update=20PVE=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E9=85=8D=E7=BD=AE.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PVE初始化配置.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/PVE初始化配置.md b/PVE初始化配置.md index e69de29..21e824e 100644 --- a/PVE初始化配置.md +++ b/PVE初始化配置.md @@ -0,0 +1,78 @@ +## 1.更换系统软件源 + +在上一篇文章中,我们从刚装好的 PVE 系统中获取了系统的一些参数: + +![PVE系统信息](img/pve_sys_info.png) + +此处显示出 PVE 底层使用的是 Debian的 系统,代号为 “bullseye”。 +为了后续能够对 PVE 系统进行升级,需要更换其镜像仓库,也就是大家熟知的软件源。 +由于我们目前处于“离线”安装状态,因此更换完软件源后,在没有网络的情况下无法对系统更新。 + +### 1.1.系统软件源替换 + +首先对现有的软件源配置进行备份: + +```bash +## 进入系统软件源配置文件目录 +cd /etc/apt + +## 将默认软件源配置文件进行备份 +cp sources.list sources.list.bak + +``` + +这里我将使用中国科技大(USTC)的镜像仓库进行替换,使用如下命令: + + **注意:该命令为两行,在输入时请逐行输入并回车执行** + +```bash +## 替换系统软件仓库 + +sed -i 's|^deb http://ftp.debian.org|deb https://mirrors.ustc.edu.cn|g' /etc/apt/sources.list +sed -i 's|^deb http://security.debian.org|deb https://mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list + +``` + +执行完成后,检查是否执行正确: + +```bash +## 输出系统源配置文件,检查是否正确 +cat /etc/apt/sources.list +``` + +如果输出结果中有 USTC 的镜像地址,则表示命令已经正确执行: + +```bash +## 输出内容参考: + +deb https://mirrors.ustc.edu.cn/debian bullseye main contrib + +deb https://mirrors.ustc.edu.cn/debian bullseye-updates main contrib + +# security updates +deb https://mirrors.ustc.edu.cn/debian-security bullseye-security main contrib + +``` + +此处我放出 Debian Bullseye 的完整镜像源以供参考, **非常不建议** 将 PVE 的系统源替换成完整的 Debian 源,以避免出现问题。 + +```bash +## Debian Bullseye 完整源 (USTC) + +deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free +#deb-src 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-src 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-src https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free + +deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free +#deb-src https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free + +``` + +可以看到,PVE 的系统源和 Debian 完整源的差异在于 “non-free” 和 “bullseye-backports”。 + +如果小伙伴在一些软件或者驱动(比如闭源 GPU 驱动)上遇到问题,可以尝试将PVE的系统源替换成Debian的完整源来尝试解决问题。