一、故障现象:
在安装了Read linux后,使用yum安装软件,出现如下提示:
[root@localhost~]# yum install xxx
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>
二、解决办法:
1、查看redhat 7.0系统本身所安装的那些yum软件包
[root@localhost~]# 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
2、卸载这些软件包
[root@localhost~]# rpm -qa | grep yum | xargs rpm -e --nodeps
[root@localhost~]# rpm -e yum-rhn-plugin-2.0.1-10.el7.noarch --nodeps
[root@localhost~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps
[root@localhost~]# rpm -e yum-3.4.3-158.el7.noarch --nodeps
3、下载RPM包并上传到readlinux(请根据版本自行更换URL)
http://mirrors.163.com/centos/7/os/x86_64/Packages/
python-kitchen*,python-chardet*,yum-utils*,yum-metadata-parser*,yum-3.4.3-163.el7.centos.noarch.rpm yum-utils*,yum-updateonboot*,yum-plugin-fastestmirror*
4、安装软件包
rpm -ivh python-*
rpm -ivh yum-*
5、新建repo 配置文件(如果是其他版本,则将下面的7改为你当前的版本数字)
vim /etc/yum.repos.d/CentOS-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]
name=CentOS-$7 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$7 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$7 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$7 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
6、测试一下就对了
yum clean all && yum makecache

**********如果难得执行上面的1-5步骤,直接的把每6步写好的RPO文件,放到/etc/yum.repos.d也能用**********

Redhat Linx使用Centos yum源的更多相关文章

  1. redhat linux使用Centos yum源

    redhat Linux如果是没有购买红帽许可的话是不能使用redhat的yum源的,但是可以通过修改使之能使用Centos的yum源. 步骤一:删除redhat的yum [root@localhos ...

  2. redhat centos yum源的安装

    redhat centos yum源的安装 1.除旧 #cd /etc/yum.repos.d #mv rhel-debuginfo.repo rhel-debuginfo.repo.bak 此处将其 ...

  3. RedHat 更新CentOS Yum源(转)

    经测试,可用.转自:https://www.cnblogs.com/tangsen/p/5151994.html 一.随笔引言 1.1随笔内容: 1.RedHat 配置Centos yum源 2.yu ...

  4. centos yum源配置 与yum配置文件

    参考博客 http://www.cnblogs.com/mchina/archive/2013/01/04/2842275.html 1.centos . yum配置文件在目录 /etc/yum.re ...

  5. RedHat 7.3 更新yum源

    title: RedHat 7.3 更新yum源 time: 2018.3.15 查看所有yum包 [root@bogon ~]# rpm -qa | grep yum yum-rhn-plugin- ...

  6. CentOS yum源设定使用方法的整理(转)

    CentOS yum更新了很多版本更新,我本人认为CentOS yum很好使的文件系统,在此向大家推荐CentOS应该是做为服务器的linux的佼佼者.CentOS采用的二进制包是rpm,不过包的依赖 ...

  7. 在VMware中为Redhat HAT配置本地yum源

    在VMware中为Redhat HAT配置本地yum源 今天准备使用CM安装大数据环境,到需要几台机器都使用同一套yum源才可以,所以想到将Redhat镜像文件拷贝到虚拟机中,在挂起使用,最后通过ht ...

  8. 【linux配置】在VMware中为Redhat HAT配置本地yum源

    在VMware中为Redhat HAT配置本地yum源 今天准备使用CM安装大数据环境,到需要几台机器都使用同一套yum源才可以,所以想到将Redhat镜像文件拷贝到虚拟机中,在挂起使用,最后通过ht ...

  9. RHEL6配置CentOS yum源

    RHEL6配置CentOS yum源

随机推荐

  1. ThreadLocal的进化——InheritableThreadLocal

    之前有介绍过 ThreadLocal,JDK 后来针对此做了一个升级版本 InheritableThreadLocal,今天就来好好介绍下. 为什么要升级 首先我们来想想,为什么要升级?这就要说起 T ...

  2. Mysql双活方案

    #### 说明 Mysql主主互备即为两个mysql的互为备份机   ##### Windows下安装步骤(Linux下步骤类似,基本就是装上mysql,然后修改配置来完成主从的设置) - step1 ...

  3. 从零开始的openGL——五、光线追踪

    前言 前面介绍了基本图形.模型.曲线的绘制,但是,在好像还没有感受到那种3D游戏里一些能惊艳到自己的效果,即真实感还不是很足.这篇文章中介绍的光线追踪,是实现真实感必不可少的.拿下面的两张图片来对比 ...

  4. 利用Bootstrap搭建网站页面

    先来看下页面效果 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

  5. 【docker】Dockerfile

    [docker]Dockerfile 转载: ============================================================= =============== ...

  6. 如何在Tomcat服务器配置CGI运行Python

    想通过请求触发部署在tomcat上的非java应用程序,需要用到Common Gateway Interface(CGI).Tomcat提供了Servlet CGI支持. 修改web.xml web. ...

  7. round分析

    Python 所谓的奇进偶弃,因为浮点数的表示在计算机中并不准确,用的时候可能要注意一下. 测试如下 print() 由运行得出结论: 当小数点左边为偶数:小数点右边X<6,舍 当小数点左边为偶 ...

  8. 新安装mariadb远程登陆配置及相关问题排查

    前言: 安装过程不再赘述,直接说问题,mysql的远程连接需要解决两个问题:1.允许root用户远程连接.2.允许任意ip远程连接数据库.当然,在测试和解决问题之前,得首先保证你的数据库与远程主机之间 ...

  9. python 多线程编程之threading模块(Thread类)创建线程的三种方法

    摘录 python核心编程 上节介绍的thread模块,是不支持守护线程的.当主线程退出的时候,所有的子线程都将终止,不管他们是否仍在工作. 本节开始,我们开始介绍python的另外多线程模块thre ...

  10. [译]C# 7系列,Part 7: ref Returns ref返回结果

    原文:https://blogs.msdn.microsoft.com/mazhou/2017/12/12/c-7-series-part-7-ref-returns/ 背景 有两种方法可以将一个值传 ...