yum源——This system is not registered to Red Hat Subscription Management


 

 

一、起因:This system is not registered with an entitlement server. You can use subscription-manager to register.

[root@localhost yum.repos.d]# yum install -y apr* autoconf automake bison bzip2 bzip2* compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.

 

二、查看並卸載RedHat7自帶已安裝的yum

rpm -qa | grep yum
rpm -qa | grep yum | xargs rpm -e --nodeps
rpm
-qa | grep yum

 

三、使用國內CenOS7的yum包來代替使用

國內的鏡像地址:http://mirrors.163.com/cenos/

 

 

 

 

 下載以下rpm最新版本(截止到2020年4月8日)

[root@localhost yum.repos.d]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
[root@localhost yum.repos.d]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-163.el7.centos.noarch.rpm^C
[root@localhost yum.repos.d]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm
[root@localhost yum.repos.d]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
[root@localhost yum.repos.d]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm

安裝所有的rpm包(最后2個rpm包要一起安裝!)

[root@localhost yum.repos.d]# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
[root@localhost yum.repos.d]# rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
[root@localhost yum.repos.d]# rpm -ivh python-urlgrabber-3.10-9.el7.noarch.rpm
[root@localhost yum.repos.d]# rpm -ivh yum-3.4.3-163.el7.centos.noarch.rpm  yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm

 

四、備份已有的repo文件

[root@localhost yum.repos.d]# pwd
[root@localhost yum.repos.d]# mv /etc/yum.repos.d/  /etc/yum.repos.d.backup

 

五、下載CentOS7相應的repo文件

[root@localhost yum.repos.d]#  wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

#替換文件中的$releasever為版本號7
[root@rhel-server yum.repos.d]# vim CentOS7-Base-163.repo

#可以使用全文替換:
:1,$s/$releasever/7

 

六、清空並重建yum緩存

[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM