将镜像源修改为国内的镜像源,比如将镜像源修改为华为云的:
一:先备份默认的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:
保存并退出:
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
其他步骤一样
也可以将镜像源设置为163
那么就不需要建立上面的huaweiyun-Centos-Stream-8.repo文件等
而是建立一个阿里云镜像源文件163-Centos-Stream-8.repo
其他步骤一样
也可以将镜像源设置为清华大学
那么就不需要建立上面的huaweiyun-Centos-Stream-8.repo文件等
而是建立一个阿里云镜像源文件tsinghua-Centos-Stream-8.repo
其他步骤一样
一:先备份默认的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 |
文章来源:
网络小编D
版权声明:
本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,请联系本站立刻删除。
