Redhat7 yum 无法使用
[root@micocube ~]# yum install gcc-c++
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
To enable Red Hat Subscription Management repositories:
subscription-manager repos --enable <repo>
To enable custom repositories:
yum-config-manager --enable <repo>
- 查看redhat 7.0系统本身所安装的那些yum软件包
[root@micocube ~]# rpm -qa | grep yum
yum-rhn-plugin-2.0.1-10.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-3.4.3-158.el7.noarch
[root@micocube ~]# rpm -e yum-rhn-plugin-2.0.1-10.el7.noarch --nodeps
[root@micocube ~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps
[root@micocube ~]# rpm -e yum-3.4.3-158.el7.noarch --nodeps
- 下载centos的yum 相关 rpm包,包下载地址,版本请从包下载地址获取最新的,可以用wget下载
python-kitchen-1.1.1-5.el7.noarch.rpm
python-chardet-2.2.1-1.el7_1.noarch.rpm
yum-3.4.3-161.el7.centos.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-utils-1.1.31-50.el7.noarch.rpm
yum-updateonboot-1.1.31-50.el7.noarch.rpm
yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
rpm -ivh python-*
rpm -ivh yum-*
- 切换到
/etc/yum.repos.d/
目录
- 从这里下载repo文件到
/etc/yum.repos.d/
目录
比如wget http://mirrors.aliyun.com/repo/Centos-7.repo
- 清除缓存
yum clean all
订阅插件提示:This system is not registered with an entitlement server. You can use subscription-manager to register.
- 这个Red Hat Subscription Manager订阅管理器,它会让你一直register,解决办法:禁用就好
脚本文件: /usr/lib/yum-plugins/subscription-manager.py
配置文件: /etc/yum/pluginconf.d/subscription-manager.conf
调用了脚本 /usr/share/rhsm/repolib.py
去重写或者更新/etc/yum.repos.d/redhat.repo文件。
每次yum调用(不禁掉plugins的情况下),都会更新此文件。
因此,为了不冲突,可以如下操作:停止掉该插件的使用,在配置文件中把enable=0即可。
[root@micocube ~] vim /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0 #将它禁用掉