CentOS 软件源设置方法

CentOS 8

  • 执行以下命令
cd /etc/yum.repos.d/
sudo rename .repo .repo.bak CentOS-*.repo
sudo curl -s -o /etc/yum.repos.d/CentOS-ISRC.repo https://mirror.iscas.ac.cn/mirror/centos-8.repo
sudo yum makecache

CentOS 7

  • 执行以下命令
cd /etc/yum.repos.d/
sudo rename .repo .repo.bak CentOS-*.repo
sudo curl -s -o /etc/yum.repos.d/CentOS-ISRC.repo https://mirror.iscas.ac.cn/mirror/centos-7.repo
sudo yum makecache

CentOS 6

  • 执行以下命令
cd /etc/yum.repos.d/
sudo rename .repo .repo.bak CentOS-*.repo
sudo curl -s -o /etc/yum.repos.d/CentOS-ISRC.repo https://mirror.iscas.ac.cn/mirror/centos-6.repo
sudo yum makecache

Q&A

  • 遇到 https://isrc.iscas.ac.cn/mirror/CentOS/7/addons/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found 的错误
    • 执行 sudo yum-config-manager --disable addons

results matching ""

    No results matching ""