||
搭建使用本地yum源是可以的,但是有时候某些软件包是找不到的,可以从网上下载,但是感觉不方便,所以尝试搭建redhat 使用centos的网络yum源。
[root@localhost ~]# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarchCodename: Tikanga
删除RedHat自带的yum源
[root@localhost ~]# rpm -aq|grep yum|xargs rpm -e --nodeps
下载新的相关软件包,这四个软件包可能会升级,如果不能下载的话可以自己去http://mirrors.163.com/centos/5/os/i386/CentOS下载最近的rpm包。
[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm
[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
安装rpm(一定要按照顺序来)
安装python-iniparse-0.2.3-6.el5.noarch.rpm
[root@localhost ~]# rpm -ivh python-iniparse-0.2.3-6.el5.noarch.rpm
warning: python-iniparse-0.2.3-6.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
file /usr/lib/python2.4/site-packages/iniparse/compat.py from install of python-iniparse-0.2.3-6.el5.noarch conflicts with file from package python-iniparse-0.2.3-4.el5.noarch
file /usr/lib/python2.4/site-packages/iniparse/compat.pyc from install of python-iniparse-0.2.3-6.el5.noarch conflicts with file from package python-iniparse-0.2.3-4.el5.noarch
file /usr/lib/python2.4/site-packages/iniparse/compat.pyo from install of python-iniparse-0.2.3-6.el5.noarch conflicts with file from package python-iniparse-0.2.3-4.el5.noarch
安装yum-metadata-parser-1.1.2-4.el5.i386.rpm
[root@localhost ~]# rpm -ivh yum-metadata-parser-1.1.2-4.el5.i386.rpm
warning: yum-metadata-parser-1.1.2-4.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [100%]
安装yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm,而且这两个包一定要一起安装,要不然会报错的。
[root@localhost ~]# rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:yum-fastestmirror ########################################### [ 50%]
2:yum ########################################### [100%]
下载
[root@localhost yum.repos.d]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
--2013-11-22 06:00:00-- http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
Resolving docs.linuxtone.org... 117.79.157.57
Connecting to docs.linuxtone.org|117.79.157.57|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1426 (1.4K) [application/octet-stream]
Saving to: `CentOS-Base.repo'
100%[===========================>] 1,426 --.-K/s in 0s
2013-11-22 06:00:01 (72.8 MB/s) - `CentOS-Base.repo' saved [1426/1426]
[root@localhost yum.repos.d]# ls
CentOS-Base.repo rhel-debuginfo.repo
执行 yum update -y(所需时间较久)
执行完这一步之后就可以使用yum源了。
[root@localhost yum.repos.d]# yum list | more
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
Deployment_Guide-en-US.noarch 5.8-1.el5.centos
installed
Deployment_Guide-zh-CN.noarch 5.8-1.el5.centos
installed
Deployment_Guide-zh-TW.noarch 5.8-1.el5.centos
installed
GConf2.i386 2.14.0-9.el5
installed
GConf2-devel.i386 2.14.0-9.el5