1、关闭官方订阅在配置文件中关闭这个官方的订阅 编辑配置文件“ 更改参数“ enabled 1”到“ enabled 0”root用户修改配置文件以下内容 vim /etc/yum/pluginconf.d/subscription-manager.conf [main] enabled02、将 Red Hat 官方订阅删除yum remove subscription-manager[rootiTOP ~]# yum remove subscription-manager Dependencies resolved. Package Architecture Version Repository Size Removing: subscription-manager x86_64 1.28.36-2.el8 anaconda 4.4 M Removing unused dependencies: dnf-plugin-subscription-manager x86_64 1.28.36-2.el8 anaconda 92 k python3-cloud-what x86_64 1.28.36-2.el8 anaconda 73 k python3-dmidecode x86_64 3.12.3-2.el8 anaconda 297 k python3-ethtool x86_64 0.14-5.el8 anaconda 90 k python3-iniparse noarch 0.4-31.el8 anaconda 106 k python3-inotify noarch 0.9.6-13.el8 anaconda 243 k python3-librepo x86_64 1.14.2-4.el8 anaconda 176 k python3-libxml2 x86_64 2.9.7-16.el8 anaconda 1.3 M python3-subscription-manager-rhsm x86_64 1.28.36-2.el8 anaconda 419 k subscription-manager-rhsm-certificates x86_64 1.28.36-2.el8 anaconda 9.5 k usermode x86_64 1.113-2.el8 anaconda 834 k Transaction Summary Remove 12 Packages Freed space: 7.9 M Is this ok [y/N]: y3、redhat 8 更换 Centos 8 阿里云镜像源备份一下 redhat.repo 文件mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.bak获取新的 CentOS-Base.repo 到 /etc/yum.repos.d/wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repoCentOS-Base.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. # # [base] nameCentOS-$releasever - Base - mirrors.aliyun.com #failovermethodpriority baseurlhttp://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/ gpgcheck1 gpgkeyhttp://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that may be useful [extras] nameCentOS-$releasever - Extras - mirrors.aliyun.com #failovermethodpriority baseurlhttp://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/ gpgcheck1 gpgkeyhttp://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that extend functionality of existing packages [centosplus] nameCentOS-$releasever - Plus - mirrors.aliyun.com #failovermethodpriority baseurlhttp://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/ gpgcheck1 enabled0 gpgkeyhttp://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [PowerTools] nameCentOS-$releasever - PowerTools - mirrors.aliyun.com #failovermethodpriority baseurlhttp://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/ gpgcheck1 enabled0 gpgkeyhttp://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [AppStream] nameCentOS-$releasever - AppStream - mirrors.aliyun.com #failovermethodpriority baseurlhttp://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/ gpgcheck1 gpgkeyhttp://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official4、更换完成之后要 进行清除缓存,生成缓存yum clean all yum makecache [rootiTOP yum.repos.d]# yum clean all yum makecache