- 下载安装 yum
Download CentOS6.3 yum i386: wget wget wget wget
x86_64: wget wget wget wget
Install CentOS6.3 yum i386: rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm rpm -ivh yum-3.2.29-30.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm (Must install both at the same time.)
x86_64: rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm rpm -ivh yum-3.2.29-30.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
- 配置 新建 /etc/yum.repos.d/CentOS5-Base.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.## file: /etc/yum.repos.d/CentOS5-Base.repo# yum clean all# yum makecache#[base]name=CentOS-5.10 - Basemirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=osgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#released updates [updates]name=CentOS-5.10 - Updatesmirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=updatesgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#packages used/produced in the build but not released[addons]name=CentOS-5.10 - Addonsmirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=addonsgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#additional packages that may be useful[extras]name=CentOS-5.10 - Extrasmirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=extrasgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#additional packages that extend functionality of existing packages[centosplus]name=CentOS-5.10 - Plusmirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#contrib - packages by Centos Users[contrib]name=CentOS-5.10 - Contribmirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=contribgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
其中 版本为 : 5.10, arch 为 x86_64, 请自己修改相应的版本号
我们看到, 对应下面的mirror列表
- 然后运行下面的目录,更新 yum repo
# yum clean all# yum make clean
- 然后就可以使用 yum 了
# yum search xxx# yum install xxx