华为云计算 云知识 CentOS如何配置
CentOS如何配置

CentOS的 镜像 地址为:https://repo.huaweicloud.com/centos/

1、备份配置文件:

cp-a/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.bak

2、两种方案,请大家自行选取。

方案一:

下载新的CentOS-Base.repo文件到/etc/yum.repos.d/目录下,可选择CentOS版本:CentOS 6/7/8

CentOS 6

执行如下命令:

wget-O/etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-6-reg.repo

方案二:

修改CentOS-Base.repo文件,取消baseurl开头的行的注释,并增加mirrorlist开头的行的注释。将文件中的http://mirror.centos.org替换成https://repo.huaweicloud.com,可以参考如下命令:

sed-i"s/#baseurl/baseurl/g"/etc/yum.repos.d/CentOS-Base.repo
sed-i"s/mirrorlist=http/#mirrorlist=http/g"/etc/yum.repos.d/CentOS-Base.repo
sed-i"s http://mirror.centos.org https://repo.huaweicloud.com g"/etc/yum.repos.d/CentOS-Base.repo

3、执行yum clean all清除原有yum缓存。

4、执行yum makecache(刷新缓存)或者yum repolist all(查看所有配置可以使用的文件,会自动刷新缓存)。

更多镜像信息可关注华为开源镜像站https://mirrors.huaweicloud.com

相关网址

CentOS官方地址:http://www.centos.org/

CentOS邮件列表地址:http://www.centos.org/modules/tinycontent/index.php?id=16

CentOS论坛地址:http://www.centos.org/modules/newbb/

CentOS文档地址:http://www.centos.org/docs/

CentOS Wiki地址:http://wiki.centos.org/

上一篇:确定实体与实体之间的关系 下一篇:远程办公软件常见功能有哪些?华为云Welink远程协同办公软件功能介绍

华为开源镜像站 Mirrors

华为开源镜像站 Mirrors

华为开源镜像站(Mirrors)是由华为云提供的开源组件、开源操作系统及开源DevOps工具镜像站,目前已提供Maven、NPM、NuGet、CentOS、Ubuntu、Debian等镜像下载服务。

免费使用

华为开源镜像站(Mirrors)是由华为云提供的开源组件、开源操作系统及开源DevOps工具镜像站,目前已提供Maven、NPM、NuGet、CentOS、Ubuntu、Debian等镜像下载服务。

免费使用