Centos Stream 8设置镜像源为阿里云,Centos Stream 8设置镜像源为华为云,Centos Stream 8设置镜像源为163

迅恒数据中心
将镜像源修改为国内的镜像源,比如将镜像源修改为华为云的:
一:先备份默认的repo文件
cd /etc/yum.repos.d/
mkdir backup
mv *.repo backup/
二:更换为华为云的镜像源(yum源)
创建新文件huaweiyun-Centos-Stream-8.repo:
touch huaweiyun-Centos-Stream-8.repo
用vi命令编辑huaweiyun-Centos-Stream-8.repo文件:
vi huaweiyun-Centos-Stream-8.repo
把以下配置拷贝到huaweiyun-Centos-Stream-8.repo:

[BaseOS]
name=BaseOS
baseurl=https://repo.huaweicloud.com/centos/8-stream/BaseOS/x86_64/os/
enabled=1
gpgcheck=0

[Appstream]
name=Appstream
baseurl=https://repo.huaweicloud.com/centos/8-stream/AppStream/x86_64/os/
enabled=1
gpgcheck=0

[Extras]
name=Extras
baseurl=https://repo.huaweicloud.com/centos/8-stream/extras/x86_64/os/
enabled=1
gpgcheck=0

[PowerTools]
name=PowerTools
baseurl=https://repo.huaweicloud.com/centos/8-stream/PowerTools/x86_64/os/
enabled=1
gpgcheck=0
保存并退出:
wq
清理原本的yum软件源列表:
yum clean all
更新新的yum软件源列表:
yum makecache
安装wget(为了刷新系统镜像源等用途):
wget --version    #如果已有wget,则跳过安装、直接进行下一步升级所有包
yum install -y wget
升级所有包同时,也升级软件和系统内核:
yum -y update

也可以将镜像源设置为阿里云
那么就不需要建立上面的huaweiyun-Centos-Stream-8.repo文件
而是建立一个阿里云镜像源文件Aliyun-Centos-Stream-8.repo

[BaseOS]
name=BaseOS
baseurl=https://mirrors.aliyun.com/centos/8-stream/BaseOS/x86_64/os/
enabled=1
gpgcheck=0

[Appstream]
name=Appstream
baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/x86_64/os/
enabled=1
gpgcheck=0

[Extras]
name=Extras
baseurl=https://mirrors.aliyun.com/centos/8-stream/extras/x86_64/os/
enabled=1
gpgcheck=0

[PowerTools]
name=PowerTools
baseurl=https://mirrors.aliyun.com/centos/8-stream/PowerTools/x86_64/os/
enabled=1
gpgcheck=0
其他步骤一样

也可以将镜像源设置为163
那么就不需要建立上面的huaweiyun-Centos-Stream-8.repo文件等
而是建立一个阿里云镜像源文件163-Centos-Stream-8.repo

[BaseOS]
name=BaseOS
baseurl=https://mirrors.163.com/centos/8-stream/BaseOS/x86_64/os/
enabled=1
gpgcheck=0

[Appstream]
name=Appstream
baseurl=https://mirrors.163.com/centos/8-stream/AppStream/x86_64/os/
enabled=1
gpgcheck=0

[Extras]
name=Extras
baseurl=https://mirrors.163.com/centos/8-stream/extras/x86_64/os/
enabled=1
gpgcheck=0

[PowerTools]
name=PowerTools
baseurl=https://mirrors.163.com/centos/8-stream/PowerTools/x86_64/os/
enabled=1
gpgcheck=0
其他步骤一样

也可以将镜像源设置为清华大学
那么就不需要建立上面的huaweiyun-Centos-Stream-8.repo文件等
而是建立一个阿里云镜像源文件tsinghua-Centos-Stream-8.repo

[BaseOS]
name=BaseOS
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8-stream/BaseOS/x86_64/os/
enabled=1
gpgcheck=0

[Appstream]
name=Appstream
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8-stream/AppStream/x86_64/os/
enabled=1
gpgcheck=0

[Extras]
name=Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8-stream/extras/x86_64/os/
enabled=1
gpgcheck=0

[PowerTools]
name=PowerTools
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/8-stream/PowerTools/x86_64/os/
enabled=1
gpgcheck=0
其他步骤一样

分类:IDC资讯 百度收录 必应收录