rhel 6.5 yum源的配置;

需求: 由于这里使用的是rhel 6.5 (Redhat Enterprise Linux 6.5),而红帽认为yum源是收费性的服务,所以我们必须删除原来安装系统时一并安装的yum才行,然后自己下载yum软件及其依赖的包安装使用; 备注: 1. yum的配置文件/etc/yum.conf和/etc/yum.repos.d/.repo 2. yum的本地缓存位置是在/etc/yum.conf定义的,默认位置为/var/cache/yum目录 3. 元数据信息的存储位置是在yum源中的repodata目录当中 问题: 在刚刚安装完毕的rhel 6.5系统women我们尝试安装 httpd 服务提示如下: [root@webserver02 ~]# yum install httpd -y 解决办法 1 查看本地安装了那些yum包 [root@webserver02 yum]# rpm -qa | grep yum yum-3.2.29-40.el6.noarch yum-plugin-security-1.1.30-14.el6.noarch yum-metadata-parser-1.1.2-16.el6.x86_64 yum-rhn-plugin-0.9.1-43.el6.noarch yum-utils-1.1.30-14.el6.noarch 2 卸载这些yum包 [root@webserver02 yum]# rpm -e yum error: Failed dependencies: yum is needed by (installed) rhn-client-tools-1.0.0.1-4.el6.noarch yum >= 3.2.19-15 is needed by (installed) yum-rhn-plugin-0.9.1-43.el6.noarch yum >= 3.2.19-15 is needed by (installed) subscription-manager-1.1.23-1.el6.x86_64 yum >= 3.2.18 is needed by (installed) yum-plugin-security-1.1.30-14.el6.noarch yum >= 3.2.29 is needed by (installed) yum-utils-1.1.30-14.el6.noarch 如上报错:说明yum被其它的软件包依赖,所以在删除时要使用rpm命令的 --nodeps 选项,顺便把subscription-manager yexiez也卸载了,原因是我们不够买红帽的服务。 [root@webserver02 yum]# rpm -e --nodeps yum [root@webserver02 yum]# rpm -e subscription-manager 3 wget yum及相关软件 wget http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm wget http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm wget http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm 如果个别 url地址出现如下情况导致下载不了的,请直接删掉后面的软件包名字或者上层及上上层目录 使用windows浏览器打开查找 找到你想要的软件 在wget 因为个别软件版本会更新。 4 [root@webserver02 yum]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm warning: python-urlgrabber-3.9.1-11.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY Preparing... ########################################### [100%] file /usr/lib/python2.6/site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-8.el6.noarch 出现如上报错说明你已经安装了python-urlgrabber-3.9.1-11.el6.noarch 你需要rpm -e python-urlgrabber xiez卸载以后在执行安装 接着安装yum主包 两个包一起安装 以为依赖关系,此时我们的yum已经安装完成,剩下的就是怎样去配置yum源了 5 网络http的yum源: 配置网络http的yum源比较简单,我们先到CentOS官方的yum源镜像网址选择合适的yum源镜像站点 CentOS官方的yum源镜像网址https://www.centos.org/download/mirrors/ >cd /etc/yum.repos.d/ >wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2 >cp centos.repo rhel-source.repo 改名 >vim rhel-source.repo# CentOS-Base.repo

![](http://i2.51cto.com/images/blog/201712/08/b8b4136b056fa10d5253afc3785183de.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
将所有的
$releasever 替换为6 然后保存退出。
**测试:**
然后将yum源中的元数据信息缓存到本地的/var/cache/yum目录当中去
> yum makecache
> [root@webserver02 yum.repos.d]# yum -y install vim

已加载插件:fastestmirror, security 设置安装进程 Determining fastest mirrors 解决依赖关系 --> 执行事务检查 ---> Package vim-enhanced.x86_64 2:7.2.411-1.8.el6 will be 升级 ---> Package vim-enhanced.x86_64 2:7.4.629-5.el6_8.1 will be an update --> 处理依赖关系 vim-common = 2:7.4.629-5.el6_8.1,它被软件包 2:vim-enhanced-7.4.629-5.el6_8.1.x86_64 需要 --> 执行事务检查 ---> Package vim-common.x86_64 2:7.2.411-1.8.el6 will be 升级 ---> Package vim-common.x86_64 2:7.4.629-5.el6_8.1 will be an update --> 处理依赖关系 vim-filesystem,它被软件包 2:vim-common-7.4.629-5.el6_8.1.x86_64 需要 --> 执行事务检查 ---> Package vim-filesystem.x86_64 2:7.4.629-5.el6_8.1 will be 安装 --> 完成依赖关系计算

依赖关系解决

======================================================================================================================================================================= 软件包 架构 版本 仓库 大小

正在升级: vim-enhanced x86_64 2:7.4.629-5.el6_8.1 base 1.0 M 为依赖而安装: vim-filesystem x86_64 2:7.4.629-5.el6_8.1 base 15 k 为依赖而更新: vim-common x86_64 2:7.4.629-5.el6_8.1 base 6.7 M

事务概要

Install 1 Package(s) Upgrade 2 Package(s)

总下载量:7.8 M 下载软件包: (1/3): vim-common-7.4.629-5.el6_8.1.x86_64.rpm | 6.7 MB 00:12
(2/3): vim-enhanced-7.4.629-5.el6_8.1.x86_64.rpm | 1.0 MB 00:01
(3/3): vim-filesystem-7.4.629-5.el6_8.1.x86_64.rpm | 15 kB 00:00

总计 534 kB/s | 7.8 MB 00:14
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY Retrieving key from http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 Importing GPG key 0xC105B9DE: Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) " From : http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 运行 rpm_check_debug 执行事务测试 事务测试成功 执行事务 Warning: RPMDB altered outside of yum. 正在安装 : 2:vim-filesystem-7.4.629-5.el6_8.1.x86_64 1/5 正在升级 : 2:vim-common-7.4.629-5.el6_8.1.x86_64 2/5 正在升级 : 2:vim-enhanced-7.4.629-5.el6_8.1.x86_64 3/5 清理 : 2:vim-enhanced-7.2.411-1.8.el6.x86_64 4/5 清理 : 2:vim-common-7.2.411-1.8.el6.x86_64 5/5 Verifying : 2:vim-enhanced-7.4.629-5.el6_8.1.x86_64 1/5 Verifying : 2:vim-common-7.4.629-5.el6_8.1.x86_64 2/5 Verifying : 2:vim-filesystem-7.4.629-5.el6_8.1.x86_64 3/5 Verifying : 2:vim-enhanced-7.2.411-1.8.el6.x86_64 4/5 Verifying : 2:vim-common-7.2.411-1.8.el6.x86_64 5/5

作为依赖被安装: vim-filesystem.x86_64 2:7.4.629-5.el6_8.1

更新完毕: vim-enhanced.x86_64 2:7.4.629-5.el6_8.1

作为依赖被升级: vim-common.x86_64 2:7.4.629-5.el6_8.1

完毕!

相关文章
相关标签/搜索