RHEL7 配置网络yum源
redhat系统安装好尽管默认带有yum,但是redhat的更新包只对注册用户有效(收费)。所以需要更换yum源。
基本的流程就是:
1.删除redhat7.0系统自带的yum软件包;
2.自行下载所需要的软件包;
3.根据依赖项安装;
4.新建repo配置文件。
一般来说,之后就可以正常使用了。可能还会遇到一些依赖项的问题,后面会提到。
流程
1、查看自带的yum软件包
| [root@192 ~]# rpm -qa | grep yum yum-utils-1.1.31-24.el7.noarch yum-langpacks-0.4.2-3.el7.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-rhn-plugin-2.0.1-4.el7.noarch PackageKit-yum-0.8.9-11.el7.x86_64 yum-3.4.3-117.el7.noarch |
这下面列出来的软件包,要记住一下,后面要根据其来搜索rpm包来安装新版本。比如”yum-utils”、”yum-langpacks”等等。
2、卸载这些安装包
[root@linuxprobe ~]# rpm -e yum-3.4.3-118.el7.noarch --nodeps |
3、保证上网正常
|
4、进入以下网站下载对应的rpm包
阿里云网络源地址:https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
网易163网络源地址:http://mirrors.163.com/
CentOS网络源地址:http://centos.ustc.edu.cn/centos/
使用CTRL+F输入关键字查找对应的安装包即可。
5、找到安装包后下载下来
由于输出结果较多,故省略,下面是输入指令:
|
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-45.el7.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm |
6、安装
输入指令rpm -ivh yum-*,遇到报错,依赖项问题。
| [root@192 ~]# rpm -ivh yum-* 警告:yum-3.4.3-161.el7.centos.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4 a80eb5: NOKEY 错误:依赖检测失败: python-urlgrabber >= 3.10-8 被 yum-3.4.3-161.el7.centos.noarch 需要 rpm >= 0:4.11.3-22 被 yum-3.4.3-161.el7.centos.noarch 需要 yum-plugin-fastestmirror 被 yum-3.4.3-161.el7.centos.noarch 需要 |
另外再回去找安装包下载下来:
|
输入指令更新rpm:
|
rpm -Uvh yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm |
小技巧: 查找需要依赖的安装包,可以在网站里搜索关键字,这样最省时最快!
再次运行rpm -ivh yum-*
| [root@192 ~]# rpm -ivh yum-* 警告:yum-3.4.3-161.el7.centos.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4 a80eb5: NOKEY 警告:软件包 yum-3.4.3-161.el7.centos.noarch 已被加入,跳过 yum-3.4.3-161.el7.ce ntos.noarch 准备中... ################################# [100%] 正在升级/安装... 1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 17%] 2:yum-plugin-fastestmirror-1.1.31-5################################# [ 33%] 3:yum-3.4.3-161.el7.centos ################################# [ 50%] 4:yum-langpacks-0.4.2-7.el7 ################################# [ 67%] 5:yum-rhn-plugin-2.0.1-10.el7 ################################# [ 83%] 6:yum-utils-1.1.31-50.el7 ################################# [100%] |
7、新建repo配置文件
创建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 |
8、测试yum是否配置成功
随便下一个软件看看:
| [root@192 ~]# yum -y install tree 已加载插件:fastestmirror, langpacks, product-id, subscription-mana ger This system is not registered to Red Hat Subscription Management. Y ou can use subscription-manager to register. Determining fastest mirrors base | 3.6 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 (1/4): extras/x86_64/primary_db | 156 kB 00:02 (2/4): base/x86_64/group_gz | 166 kB 00:02 (3/4): updates/x86_64/primary_db | 1.3 MB 00:03 (4/4): base/x86_64/primary_db | 6.0 MB 00:03 正在解决依赖关系 --> 正在检查事务 ---> 软件包 tree.x86_64.0.1.6.0-10.el7 将被 安装 --> 解决依赖关系完成 |

RHEL7 配置网络yum源的更多相关文章
- Linux配置网络YUM源
配置网络yum源 RHEL6.5 [root@xuegod163 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun ...
- 配置网络yum源
有的时候服务器需要下载一些软件,是本地yum源没有的,这时候需要配置网络yum源 #cd /etc/yum.repos.d/ 把这个目录下的配置文件备份,改名:或者是把文件里边的enabled=1的 ...
- CentOS 配置网络yum源
配置网络yum源(需要保证外网开通,使用网易163提供开源镜像站) 1.下载repo文件 方法一:下载到本地windows再上传到linux服务器上: 下载地址 : http://mirrors.16 ...
- CentOS7下配置网络yum源(附带下载地址)
一.查看外网是否通畅 配置网络yum源(需要保证外网开通,我这里是使用网易163提供开源镜像站) 二.下载repo文件 cd /etc/yum.repos.dwget http://mirrors.1 ...
- rhel配置网络yum源
redhat 7.2配置网易yum源 卸载原来的yum源和安装必须的rpm包 1)确保虚拟机能够连接外网 2)前往http://mirrors.163.com/centos/7/os/x86_64/P ...
- centos配置网络yum源 和本地yum源
一,网络yum源 1.备份 yum文件 cd /etc/ cp -r yum.repos.d yum.repos.d.bak 2.在系统联网的情况下执行下面命令下载 wget -O /etc/yu ...
- 安装RHEL7配置本地yum源 -- yum不能安装时,在本地安装,亲测成功
RHEL7 本地yum源配置我们在安装Redhat的时候一般都不会填写注册信息,因为该产品是要购买的,所以我们在使用安装好的Redhat时有的功能是受限的,使用yum源install就是其中之一.那么 ...
- RHEL7.2和RHEL6.5的配置网络yum源和本地yum源
RHEL7.2配置本地yum源 [root@localhost ~]#monut /dev/sr0 /mnt #挂载光盘 [root@localhost ~]# rm -rf /etc/yu ...
- CentOS配置本地yum源(使用镜像iso文件)
本人在使用yum安装软件的时候,感觉最不爽的是网络不佳时,安装的速度特别慢.所以,个人就上网search了一下如何使用Linux的安装文件作为其yum源.经过几次尝试,已经可以成功的配置了.下面是详细 ...
随机推荐
- 【easy】572. Subtree of Another Tree
判断一棵树中是否包含另一棵子树(包含是,两棵树重合处的根节点之下的子节点都相等) 有两种方法: 方法二:递归写法 //方法一:可以借鉴之前序列化的题目,如果序列化得到的序列一样就是相同的树 //方法二 ...
- hdu 1241 Oil Deposits (简单搜索)
题目: The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. ...
- 8266编译错误 xtensa-lx106-elf/bin/ld: segmentled section `.text' will not fit in region `iram1_0_seg'
一种简单的解决办法 Okay, the solution was to copy the libgcc.a file from: esp-open-sdk/ESP8266_NONOS/lib/ to ...
- 详解MariaDB数据库的外键约束
1.什么是外键约束 外键约束(foreign key)就是表与表之间的某种约定的关系,由于这种关系的存在,我们能够让表与表之间的数据,更加的完整,关连性更强. 关于数据表的完整性和关连性,可以举个例子 ...
- set操作
Set操作,Set集合就是不允许重复的列表 sadd(name,values) # name对应的集合中添加元素 scard(name) 获取name对应的集合中元素个数 sdiff(keys, *a ...
- 饮冰三年-人工智能-Python-30 python开发中常见的错误
1:触发条件:创建的实体类生成到数据库表时报错 报错信息:TypeError: __init__() missing 1 required positional argument: 'on_delet ...
- 饮冰三年-人工智能-Python-29瀑布流
多适用于:整版以图片为主,大小不一的图片按照一定的规律排列的网页布局. 1:创建model类,并生成数据表 from django.db import models # Create your mod ...
- C#学习-接口与抽象类
接口与抽象类的区别 1.抽象类中可以包含虚方法.非抽象方法和静态成员: 当接口中不能包含虚方法和任何静态成员,并且接口中只能定义方法,不能有具体事项,方法的具体实现由实现类完成. 2.抽象类不能实现多 ...
- php框架rbac功能分析
四大php框架rbac功能分析对比
- JS数字转中文
function number2Chinese(n) { if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) return '数据非法'; let unit = '京亿万仟佰 ...