yum的网络源文件 配置Red Hat Enterprise Linux Server 5使用CentOS 163 yum源更新
(2012-08-30 23:56:06)
标签:
yum
163
centos
redhat
error404
it
分类:技术文档
1、[root@localhost ~]# cd /etc/yum.repos.d
wget --163 yum源
wget --sohu yum源
yum makecache
yum update
2、将mirrors.163.com的IPv4地址...
Red Hat Enterprise Linux Server 5使用CentOS 163 yum源更新
(2012-08-30 23:56:06)
标签:
yum
163
centos
redhat
error404
it
分类:技术文档
1、[root@localhost ~]# cd /etc/yum.repos.d
wget --163 yum源
wget --sohu yum源
yum makecache
yum update
2、将mirrors.163.com的IPv4地址写入到/etc/hosts文件
[root@localhost ~]# echo `host mirrors.163.com|cut -d' ' -f 4` mirrors.163.com >> /etc/hosts
3、删除redhat原有的yum源
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
4、下载CentOS的yum安装包(163源)
wget
wget
wget
wget
5、安装yum软件包
rpm -ivh yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm
rpm -ivh yum-3.2.22-39.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。
6、更改yum源 #我们使用网易的CentOS镜像源
cd /etc/yum.repos.d/
vi CentOS6-Base-163.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-$releasever - Base - 163.com
#mirrorlist=$releasever&arch=$basearch&repo=os
baseurl=$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=$releasever&arch=$basearch&repo=updates
baseurl=$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons - 163.com
#mirrorlist=$releasever&arch=$basearch&repo=addons
baseurl=$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=$releasever&arch=$basearch&repo=extras
baseurl=$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
#mirrorlist=$releasever&arch=$basearch&repo=centosplus
baseurl=$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
#mirrorlist=$releasever&arch=$basearch&repo=contrib
baseurl=$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
7、清理
yum clean all
8、测试
yum install vim #测试一下可不可以用
至此,Redhat6可以使用CentOS的yum源在线安装软件了!
本文档为【yum的网络源文件 配置】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。