当前位置:   article > 正文

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

redhat8使用centos源

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/目录下

  1. [root@server130 yum.repos.d]# cat Centos-8.repo
  2. # CentOS-Base.repo
  3. #
  4. # The mirror system uses the connecting IP address of the client and the
  5. # update status of each mirror to pick mirrors that are updated to and
  6. # geographically close to the client. You should use this for CentOS updates
  7. # unless you are manually picking other mirrors.
  8. #
  9. # If the mirrorlist= does not work for you, as a fall back you can try the
  10. # remarked out baseurl= line instead.
  11. #
  12. #
  13. [base]
  14. name=CentOS-$releasever - Base - mirrors.aliyun.com
  15. #failovermethod=priority
  16. baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
  17. http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
  18. http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
  19. gpgcheck=1
  20. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
  21. #additional packages that may be useful
  22. [extras]
  23. name=CentOS-$releasever - Extras - mirrors.aliyun.com
  24. #failovermethod=priority
  25. baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
  26. http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/
  27. http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/
  28. gpgcheck=1
  29. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
  30. #additional packages that extend functionality of existing packages
  31. [centosplus]
  32. name=CentOS-$releasever - Plus - mirrors.aliyun.com
  33. #failovermethod=priority
  34. baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/
  35. http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
  36. http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
  37. gpgcheck=1
  38. enabled=0
  39. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
  40. [PowerTools]
  41. name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
  42. #failovermethod=priority
  43. baseurl=http://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/
  44. http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
  45. http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
  46. gpgcheck=1
  47. enabled=0
  48. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
  49. [AppStream]
  50. name=CentOS-$releasever - AppStream - mirrors.aliyun.com
  51. #failovermethod=priority
  52. baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
  53. http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
  54. http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
  55. gpgcheck=1
  56. 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缓存

  1. [root@server130 yum.repos.d]# yum clean all
  2. Updating Subscription Management repositories.
  3. Unable to read consumer identity
  4. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  5. 18 files removed

4、缓存包信息

  1. [root@server130 yum.repos.d]# yum makecache
  2. Updating Subscription Management repositories.
  3. Unable to read consumer identity
  4. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  5. CentOS-8 - Base - mirrors.aliyun.com 3.2 MB/s | 4.6 MB 00:01
  6. CentOS-8 - Extras - mirrors.aliyun.com 22 kB/s | 10 kB 00:00
  7. CentOS-8 - AppStream - mirrors.aliyun.com 3.4 MB/s | 8.4 MB 00:02
  8. Metadata cache created.

5、查看配置的yum仓库

  1. [root@server130 yum.repos.d]# yum repolist all
  2. Updating Subscription Management repositories.
  3. Unable to read consumer identity
  4. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  5. repo id repo name status
  6. AppStream CentOS-8 - AppStream - mirrors.aliyun.com enabled
  7. PowerTools CentOS-8 - PowerTools - mirrors.aliyun.com disabled
  8. base CentOS-8 - Base - mirrors.aliyun.com enabled
  9. centosplus CentOS-8 - Plus - mirrors.aliyun.com disabled
  10. extras CentOS-8 - Extras - mirrors.aliyun.com enabled

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/576256
推荐阅读
相关标签
  

闽ICP备14008679号