差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 | |||
is:cos:centos更换源 [2025/02/17 04:03] – 移除 - 外部编辑 (未知日期) 127.0.0.1 | is:cos:centos更换源 [2025/02/17 04:03] (当前版本) – ↷ 页面is:centos更换源被移动至is:cos:centos更换源 A.L | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | [[category: | ||
+ | ====== CentOS 更换源指南 ====== | ||
+ | |||
+ | ===== CentOS 7 更换源 ===== | ||
+ | |||
+ | **备份原仓库配置文件**: | ||
+ | <code bash> | ||
+ | mv / | ||
+ | </ | ||
+ | |||
+ | **下载新的 Repo 文件**: | ||
+ | <code bash> | ||
+ | wget -O / | ||
+ | </ | ||
+ | |||
+ | **完成替换后执行**: | ||
+ | <code bash> | ||
+ | yum clear all | ||
+ | yum makecache | ||
+ | </ | ||
+ | |||
+ | ===== CentOS 8 更换源 ===== | ||
+ | |||
+ | **备份原仓库配置文件**: | ||
+ | <code bash> | ||
+ | cp / | ||
+ | cp / | ||
+ | cp / | ||
+ | </ | ||
+ | |||
+ | **修改 CentOS-AppStream.repo 文件**: | ||
+ | <code bash> | ||
+ | # mirrorlist=http:// | ||
+ | baseurl=https:// | ||
+ | </ | ||
+ | |||
+ | **修改 CentOS-Base.repo 文件**: | ||
+ | <code bash> | ||
+ | # mirrorlist=http:// | ||
+ | baseurl=https:// | ||
+ | </ | ||
+ | |||
+ | **修改 CentOS-Extras.repo 文件**: | ||
+ | <code bash> | ||
+ | # mirrorlist=http:// | ||
+ | baseurl=https:// | ||
+ | </ | ||
+ | |||
+ | **完成替换后执行**: | ||
+ | <code bash> | ||
+ | dnf clear all | ||
+ | dnf makecache | ||
+ | </ |