[iyunv@localhost ~]# cd /etc/yum.repos.d/ ##切换到yum源配置目录
####下载网易yum源
[iyunv@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
[iyunv@localhost yum.repos.d]# vi CentOS6-Base-163.repo ##使用vi编辑yum配置文件将文件中$releasever的替换成6。在末行模式执行此命令括号中的命令(:% s/$releasever/6/g)共替换15处。
五、清除yum缓存
[iyunv@localhost yum.repos.d]# yum clean all ##清除缓存
[iyunv@localhost yum.repos.d]# yum makecache ##将服务器上的软件包缓存到本地
[iyunv@localhost yum.repos.d]# yum -y install httpd ##测试安装httpd服务
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
--> Processing Dependency: httpd = 2.2.15-29.el6_4 for package: httpd-devel-2.2.15-29.el6_4.x86_64
---> Package httpd.x86_64 0:2.2.15-39.el6.centos set to be updated
--> Processing Dependency: httpd-tools = 2.2.15-39.el6.centos for package: httpd-2.2.15-39.el6.centos.x86_64
--> Running transaction check
---> Package httpd-devel.x86_64 0:2.2.15-39.el6.centos set to be updated
---> Package httpd-tools.x86_64 0:2.2.15-39.el6.centos set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================
Updating:
httpd x86_64 2.2.15-39.el6.centos base 825 k
Updating for dependencies:
httpd-devel x86_64 2.2.15-39.el6.centos base 152 k
httpd-tools x86_64 2.2.15-39.el6.centos base 75 k