用户国营 发表于 2024-6-20 20:44:24

redhat linux 8 安装 阿里云centos-8 yum源(网络yum源配置)

1、起因:
使用redhat自带镜像yum源安装软件时,报错:unable to read consumer identity。这个提示告诉我们,yum没有读取到你的用户id。假如你想使用redhat同步不想耗费几千元注册体系,就可以使用centos的yum源来取代。
2、centos-8 yum网络源配置
        2.1、访问阿里云镜像站,下载repo镜像下载页
        地址:https://mirrors.aliyun.com/repo/
        下载:Centos-8.repo
        打开所下载的centos-8.repo,上传至/etc/yum.repos.d/目录下
# cat Centos-8.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#


name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
      http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
      http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that may be useful

name=CentOS-$releasever - Extras - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
      http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/
      http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that extend functionality of existing packages

name=CentOS-$releasever - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/
      http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
      http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official


name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/
      http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
      http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official



name=CentOS-$releasever - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
      http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
      http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

        2.2、直接在服务器上直接wget下载repo配置文件至/etc/yum.repos.d/目录下
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo 3、清除yum缓存
# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

18 files removed
4、缓存包信息
# yum makecache
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

CentOS-8 - Base - mirrors.aliyun.com               3.2 MB/s | 4.6 MB   00:01   
CentOS-8 - Extras - mirrors.aliyun.com            22 kB/s |10 kB   00:00   
CentOS-8 - AppStream - mirrors.aliyun.com          3.4 MB/s | 8.4 MB   00:02   
Metadata cache created.
5、检察配置的yum仓库
# yum repolist all
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

repo id            repo name                                             status
AppStream            CentOS-8 - AppStream - mirrors.aliyun.com             enabled
PowerTools         CentOS-8 - PowerTools - mirrors.aliyun.com            disabled
base               CentOS-8 - Base - mirrors.aliyun.com                  enabled
centosplus         CentOS-8 - Plus - mirrors.aliyun.com                  disabled
extras               CentOS-8 - Extras - mirrors.aliyun.com                enabled


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: redhat linux 8 安装 阿里云centos-8 yum源(网络yum源配置)