REDHAT安装网易YUM源

1 :使用 wget http://mirrors.163.com/.help/CentOS-Base-163.repo 生成源文件
[root@localhost ~]# wget http://mirrors.163.com/.help/CentOS-Base-163.repo
--2012-11-28 23:23:42--  http://mirrors.163.com/.help/CentOS-Base-163.repo
正在解析主机 mirrors.163.com... 123.58.173.89, 123.58.173.106
Connecting to mirrors.163.com|123.58.173.89|:80...
已连接。
已发出 HTTP 请求,正在等待回应 ... 200 OK
长度: 2287 (2.2K) [application/octet-stream]
Saving to: `CentOS-Base-163.repo'
100%[======================================>] 2,287       7.56K/s   in 0.3s   
2012-11-28 23:23:44 (7.56 KB/s) - `CentOS-Base-163.repo' saved [2287/2287]
 
2 :生成的源文件
[root@localhost ~]# ls
anaconda-ks.cfg       Desktop      install.log.syslog
CentOS-Base-163.repo  install.log  vmware-tools-distrib
 
CentOS-Base-163.repo 文件拷贝到 /etc/yum.repos.d/ 下改名为 redhat-163.repo
cp CentOS-Base-163.repo redhat-163.repo

3 :使用 vim 打开 redhat-163.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/5/os/$basearch/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#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/5/updates/$basearch/
gpgcheck=0
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=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
gpgcheck=0
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=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/5/extras/$basearch/
gpgcheck=0
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=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/
gpgcheck=0
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=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/5/contrib/$basearch/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

4 :使用 yum makecache 生成原数据缓存

5 :使用 yum update 更新
以上是 redhat 配置网易 163 yum 源,这样就可以使用 yum 源了。
 

你可能感兴趣的:(redhat安装YUM源)