解除原有源
rpm -aq|grep yum|xargs rpm -e --nodeps
rpm -aq|grep python-iniparse|xargs rpm -e --nodeps

rpm -qa | grep yum
检验是否删除干净
下载四个包:
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
# wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
# wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
# wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm包

wget -c http://centos.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm

rpm -ivh *.rpm
注意可能需要根据提示多删除或添加一些包
rpm -qa | grep yum
检验yum是否安装成功

替换文件内容,注意repo网址需可达
vim /etc/yum.repos.d/CentOS-Base.repo

[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7.1.1503/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7.1.1503/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7.1.1503/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extendfunctionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7.1.1503/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

yum clean all

yum makecache

redhat换用centos源的更多相关文章

  1. redhat 6 使用centos源 yum安装

    1.删除redhat原有的yum源 # rpm -aq | grep yum|xargs rpm -e --nodeps 2.下载新的yum安装包 这里我们使用CentOS的yum源 # wget h ...

  2. Centos-Redhat下远程桌面的方法 & Redhat改Centos源

    折腾了好几天才搞定,Redhat下远程桌面的方法,首先保证本身已经装了桌面,并且可以ssh访问 由于系统中自带python2环境,装了anaconda以及它带的python3环境,这个必须存在(前提) ...

  3. redhat 配置本地yum源

    redhat配置3个源就够了: 1.本地yum源,就是你本地的ISO 2.配置163源 3.配置epel源 环境:redhat7 + vmw 12 pro 1.配置本地yum源 要配置本地源,需要先把 ...

  4. 【转】Linux CentOS内核编译:下载CentOS源码、编译2.6.32-220的错误(apic.c:819 error 'numi_watchdog' undeclared)

    一.下载CentOS源码 1.1 查看CentOS版本 cat /etc/issue 1.2 查看Linux内核版本 uname -r 1.3 下载 文件名:kernel-2.6.32-220.el6 ...

  5. Redhat YUM U盘源配置

    Redhat YUM U盘源配置 1)在U盘创建目录 #mkdir /yum/Server 并从光盘Server.Packages 目录的所有文件拷贝到/yum/Server 2)安装 creater ...

  6. CentOS源码安装QT

    在VirtualBox上的CentOS下安装qt-everywhere-opensource-src-4.8.4 ,执行 ./confiure时失败,失败信息为:Basic XLib function ...

  7. bundle install 老是中断,可以在gemfile里面把source换成taobao源,可以自动安装

    bundle install 老是中断,可以在gemfile里面把source换成taobao源,可以自动安装

  8. Linux基础学习-RHEL7.4之YUM更换CentOS源

    1.配置YUM本地源 1.挂载镜像 [root@qdlinux ~]# mount /dev/cdrom /mnt 2.查看是否挂载成功 [root@qdlinux ~]# df -h Filesys ...

  9. CentOS 源设置

    安装完CentOS后,系统默认的源可能有限满,这时我们需要添加国内比较好的源. 一.国内比较好的源https://opsx.alibaba.com/mirror                  #阿 ...

随机推荐

  1. ASP.NET服务器端控件原理分析

    服务器端控件触发事件分两种: 1.服务器端控件Button被渲染成客户端的 <input type="submit" name="Button1" val ...

  2. windows下用bat启动jar包,修改cmd标题(title)

    新建start.bat,输入以下内容即可. @echo off title myprogress-%date%-%time%-%cd% java -jar myprogress.jar

  3. Hessian使用

    ps:以前在项目中用过hessian,但我仅停留在知道这个层面,后面也没有详细了解其中的原理.现在要写简历都不知道怎么写,自己挖的坑,跪着也要填平. Hessian的使用 这里先写下工程中的使用,有个 ...

  4. TCP UDP 数据包过大导致分片情况

    MTU大家都知道,是链路层中的网络对数据帧的一个限制,依然以以太网为例,MTU为1500个字节.一个IP数据报在以太网中 传输,如果它的长度大于该MTU值,就要进行分片传输,使得每片数据报的长度小于M ...

  5. 解决编译安装php时报错:Please reinstall the iconv library

    编译安装php7时报错“Please reinstall the iconv library”,也就是让重新安装iconv库.但yum安装又提示“No package libiconv availab ...

  6. Hbase记录-HBaseAdmin类

    HBaseAdmin是一个类表示管理.这个类属于org.apache.hadoop.hbase.client包.使用这个类,可以执行管理员任务.使用Connection.getAdmin()方法来获取 ...

  7. bootstrap中模态框的使用

    1.代码: <%--登录模态框--%> <li><a href="#" data-toggle="modal" data-targ ...

  8. python(nmap模块、多线程模块)

    http://xael.org/pages/python-nmap-en.html       nmap模块 http://www.tutorialspoint.com/python/python_m ...

  9. xss漏洞利用

    简述 跨站脚本攻击(也称为XSS)指利用网站漏洞从用户那里恶意盗取信息.攻击者通过在链接中插入恶意代码,就能够盗取用户信息.攻击者通常会在有漏洞的程序中插入 JavaScript.VBScript. ...

  10. JavaScript客户端签名直传OSS

    参考链接: https://help.aliyun.com/document_detail/31925.html?spm=5176.11065259.1996646101.searchclickres ...