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

redhat7.9

今天装完后Redhat7.9忘记了yum的问题,在安装命令时提示如下:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


关掉这个提示:
~]# vi /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0       ====> 将1改为0

~]# vi /etc/yum/pluginconf.d/product-id.conf
[main]
enabled=0            ====> 改为0



# 找了下方法便于以后使用
~]# rpm -qa|grep yum
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-rhn-plugin-2.0.1-10.el7.noarch
yum-3.4.3-168.el7.noarch

# 将自带的yum包删除
~]# rpm -qa|grep yum|xargs rpm -e --nodeps
# 再来查看则回显为空
~]# rpm -qa|grep yum

~]# curl -o  python-urlgrabber-3.10-10.el7.noarch.rpm  http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm

~]# curl -o yum-3.4.3-168.el7.centos.noarch.rpm  http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm 

~]# curl -o yum-rhn-plugin-2.0.1-10.el7.noarch.rpm http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/yum-rhn-plugin-2.0.1-10.el7.noarch.rpm  

~]# curl -o yum-metadata-parser-1.1.4-10.el7.x86_64.rpm http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

~]# curl -o  yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm  http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm

~]# curl -o  yum-utils-1.1.31-54.el7_8.noarch.rpm  http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/yum-utils-1.1.31-54.el7_8.noarch.rpm

~]# curl -o  python-chardet-2.2.1-3.el7.noarch.rpm  http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm

~]# curl -o  python-kitchen-1.1.1-5.el7.noarch.rpm  http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm

~]# rpm -ivh python-urlgrabber-3.10-10.el7.noarch.rpm
warning: python-urlgrabber-3.10-10.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
	package python-urlgrabber-3.10-10.el7.noarch is already installed
	file /usr/lib/python2.7/site-packages/urlgrabber/grabber.pyc from install of python-urlgrabber-3.10-10.el7.noarch conflicts with file from package python-urlgrabber-3.10-10.el7.noarch
	file /usr/lib/python2.7/site-packages/urlgrabber/grabber.pyo from install of python-urlgrabber-3.10-10.el7.noarch conflicts with file from package python-urlgrabber-3.10-10.el7.noarch



~]# rpm -ivh python-chardet-2.2.1-3.el7.noarch.rpm
warning: python-chardet-2.2.1-3.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:python-chardet-2.2.1-3.el7       ################################# [100%]


~]# rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm
warning: python-kitchen-1.1.1-5.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:python-kitchen-1.1.1-5.el7       ################################# [100%]


~]# rpm -ivh yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm \
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm \
yum-rhn-plugin-2.0.1-10.el7.noarch.rpm \
yum-utils-1.1.31-54.el7_8.noarch.rpm \
yum-3.4.3-168.el7.centos.noarch.rpm 
warning: yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 20%]
   2:yum-3.4.3-168.el7.centos         ################################# [ 40%]
   3:yum-plugin-fastestmirror-1.1.31-5################################# [ 60%]
   4:yum-rhn-plugin-2.0.1-10.el7      ################################# [ 80%]
   5:yum-utils-1.1.31-54.el7_8        ################################# [100%]


~]# rpm -qa|grep yum
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch
yum-utils-1.1.31-54.el7_8.noarch
yum-3.4.3-168.el7.centos.noarch
yum-rhn-plugin-2.0.1-10.el7.noarch


# 安装wget
~]# curl -o wget-1.14-18.el7_6.1.x86_64.rpm http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/wget-1.14-18.el7_6.1.x86_64.rpm
~]# rpm -ivh wget-1.14-18.el7_6.1.x86_64.rpm
~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

================================
http://mirrors.163.com/centos/

================================

# 重点
~]# vi /etc/yum.repos.d/CentOS-Base.repo
将所有
http://mirrors.163.com/centos/$releasever/os/$basearch/
替换为
http://mirrors.163.com/centos/7.9.2009/os/x86_64                 ====> 明确指明版本和架构 


或者直接用命令替换
~]# sed -i "s/\$releasever/7.9.2009/g" /etc/yum.repos.d/CentOS-Base.repo
~]# sed -i "s/\$basearch/x86_64/g" /etc/yum.repos.d/CentOS-Base.repo



~]# yum clean all && yum makecache
~]# yum -y install vim lrzsz net-tools bind-utils

redhat8.5

暂且只能用光盘通过loop挂载上去进行使用

~]# vi /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0            ====> 改为0

disable_system_repos=0

~]# vi /etc/yum/pluginconf.d/product-id.conf
[main]
enabled=0            ====> 改为0


# 将ISO镜像放到software目录下
~]# mkdir /software/ && cd /software/
# 创建挂载点并挂载光盘
~]# mkdir /local_dvd
~]# mount -o loop /software/rhel-8.5-x86_64-dvd.iso  /local_dvd

# 创建yum源
~]# vim /etc/yum.repos.d/local_dvd.repo
[local_repo]
name=localhost8
baseurl=file:///local_dvd/BaseOS
enable=1
gpgcheck=0

[local_repo_APP]
name=localhost8_app
baseurl=file:///local_dvd/AppStream
enable=1
gpgcheck=0


~]# yum clean all && yum makecache && yum repolist
~]# yum -y install lrzsz vim net-tools bind-utils

.
.
.
.
游走在各发行版间老司机QQ群:905201396
不要嫌啰嗦的新手QQ群:756805267
Debian适应QQ群:912567610

posted @ 2022-03-24 12:42  Linux大魔王  阅读(1541)  评论(0编辑  收藏  举报