使用rhel7.5系统中自带的yum会报如下的错误:
[root@test2 ~]# yum repolist
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
repolist: 0

如果在rhel7.5上想使用yum,需要删除系统自带的yum,重新安装
rpm -qa | grep subscription-manager- | xargs rpm -e --nodeps
如果执行失败,则将上述命令分开执行
rpm -qa | grep subscription-manager-

再使用
rpm -e --nodeps +上一条语句执行的结果,删除自带的yum

安装yum:
rpm -ivh http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

配置yum源:
cd /etc/yum.repos.d/
手动创建repo文件 vi base.repo
输入内容如下:
[base]
name=CentOS-7 -Base
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=0

此时,配置完成,可以使用yum进行软件安装