Linux Redhat 7 安装免费yum源

出处地址:http://www.cnblogs.com/nbartchen/p/8565816.html

1、查看是否安装相关包

rpm -qa|grep yum|xargs rpm -e --nodeps

2、下载rpm包到本地、并安装

curl -O http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-163.el7.centos.noarch.rpm
curl -O http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
curl -O http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm

3、安装rpm包

rpm -ivh yum-*

4、备份redhat yum源,新建免费yum源目录

mv /etc/yum.repos.d/ /etc/yum.repos.d.backup
mkdir /etc/yum.repos.d

5、下载yum Centos7 yum源、移动到yum目录

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
mv CentOS7-Base-.repo /etc/yum.repos.d

6、修改文件相关内容

# 进入文件 编辑 CentOS7-Base-163.repo
:%s/$releasever//g

7、更新yum缓存测试使用

yum clean all
yum makecache
yum repolist all

注:如上述不生效需采取另一种方式

rpm -ivh yum-*
警告:yum-3.4.-.el7.centos.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
错误:依赖检测失败:
python-urlgrabber >= 3.10- 被 yum-3.4.-.el7.centos.noarch 需要
rpm >= :4.11.- 被 yum-3.4.-.el7.centos.noarch 需要

报错

1、python-urlgrabber和rpm包升级

curl -O http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
curl -O http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm
rpm -Uvh rpm-4.11.3-40.el7.x86_64.rpm --nodeps 
rpm -Uvh python-urlgrabber-3.10-9.el7.noarch.rpm --nodeps

2、添加vim源

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

配置文件

3、更新yum缓存测试使用

yum clean all
yum makecache
yum repolist all

Linux Redhat 安装免费yum源的更多相关文章

  1. Linux 安装扩展yum源

    Linux 安装扩展yum源 下载rpm扩展:http://rpmfind.net/linux/epel/6/x86_64/epel-release-6-8.noarch.rpm CentOS/RHE ...

  2. Linux 安装 EPEL YUM源

    原文:https://blog.csdn.net/harbor1981/article/details/51135623 我们用yum安装软件时,经常发现我们的yum源里面没有该软件,需要自己去wge ...

  3. RedHat 更新CentOS Yum源(转)

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

  4. rhel6.5安装网络yum源过程

    **redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装其他yum源,再配置其他源.** 本文包括配置本地源及第三方源.第三方源包括:网 ...

  5. CentOS 开启安装EPEL YUM源

    我们用yum安装软件时,经常发现我们的yum源里面没有该软件,需要自己去wget,然后configure,make,make install,太折腾了. 其实,CentOS 还有一个源叫做 EPEL ...

  6. RedHat Linux RHEL6配置本地YUM源

    YUM是Yellow dog Updater Modified的简称,起初是由yellow dog这一发行版的开发者Terra Soft研发,用python写成,那时还叫做yup(yellow dog ...

  7. Linux服务器redhat配置本地yum源

    前面给大家介绍了很多在Linux安装软件的知识,这些软件往往依赖了很多第三方的工具或者软件,如果在Linux服务器有外网的情况,咱们可以通过yum install这样的命令直接去安装这些相关的工具或者 ...

  8. Linux中的安装神器--yum源安装

    linux配置yum源 一.修改yum的配置文件     /etc/yum.repos.d/xxx.repo          1.进入yum配置文件目录        # cd /etc/yum.r ...

  9. linux(readhat) yum源安装

    在安装測试环境的时候遇到了一个问题,/etc/yum/repos.d中不存在文件或目录,无法更新yum源. 解决方法: (一.配置网络yum源) 1.首先在/etc/yum/repos.d/文件夹下创 ...

随机推荐

  1. js动态规划---背包问题

    //每种物品仅有一件,可以选择放或不放 //即f[i][w]表示前i件物品恰放入一个容量为w的背包可以获得的最大价值. //则其状态转移方程便是:f[i][w]=max{f[i-1][w],f[i-1 ...

  2. 用于模型选择的AIC与BIC

    一.AIC(Akaike information Criterion)准则 二.BIC(Bayesian information Criterion)准则 参考文献: [1]AIC与BIC区别

  3. vim 常用

    Format JSON :%!python -m json.tool 1. define custom function and use it define function in .vimrc fu ...

  4. PO模型

    大神绕道而行,自我小白的笔记,仅此 一.创建文件夹,创建xxx.ini文件用来存放界面的定位元素,用 [界面_element]-->界面, 来划分界面界面元素,维护方便.定位元素的格式:  us ...

  5. grunt的用法一

    grunt也是工程化管理工具之一 首先你需要全局安装grunt,打开cmd命令 cnpm install -g grunt-cli 然后在你项目目录下执行 cnpm install --save gr ...

  6. JavaScript 深入了解对象中的属性

    本篇主要介绍JS中对象的属性,包括:属性的分类.访问方式.检测属性.遍历属性以及属性特性等内容. 目录 1. 介绍:描述属性的命名方式.查找路径以及分类 2. 属性的访问方式:介绍'.'访问方式.'[ ...

  7. vs远程调试 转http://www.cnblogs.com/magicchaiy/archive/2013/05/28/3088274.html

    远程调试应用场景 部署环境:ASP.NET(C#)+IIS+Win7 64 bit 很多公司的开发模式都是将开发机器和服务器分开,也就是开发一台机,服务器一台机.而测试人员会在服务器上录入测试数据,此 ...

  8. word2vector 资料

    http://blog.csdn.net/garfielder007/article/details/51345201 https://cs224d.stanford.edu/lecture_note ...

  9. SpringMVC探究-----常用获取传递参数的方法

       1.@RequestParam @RequestParam 常用来映射请求参数,它有三个属性可以配置: value 值即请求参数的参数名 required 该参数是否必须. 默认为 true d ...

  10. ssh 免登录

    1. 生成 ssh 公钥和私钥 xiluhua@vm-xiluhua ~ $ ssh-keygen Generating public/private rsa key pair. Enter file ...