第三步:配置yum客户端使用此仓库即可;
[root@CentOS6 yum.repos.d]# vim test.repo #编辑指向yum库的repo文件
[c6-test]
name=CentOS-$releasever - test
baseurl=file:///var/www/html/test
gpgcheck=0 #此处只为实验,没有复制密钥,到yum库中,所以不启用校验;
enabled=1 #启用
[root@CentOS6 yum.repos.d]# yum clean all #清除缓存;
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: c6-test
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@CentOS6 yum.repos.d]# yum repolist #显示可用的repo;
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
c6-test | 2.9 kB 00:00 ...
c6-test/primary_db | 3.2 kB 00:00 ...
repo id repo name status
c6-test CentOS-6 - test 1
repolist: 1
[root@CentOS6 yum.repos.d]# yum -y install zsh #安装zsh;
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package zsh.i686 0:4.3.10-7.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================
Package Arch Version Repository Size
==========================================================================
Installing:
zsh i686 4.3.10-7.el6 c6-test 2.1 M
Transaction Summary
==========================================================================
Install 1 Package(s)
Total download size: 2.1 M
Installed size: 4.6 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : zsh-4.3.10-7.el6.i686 1/1
Verifying : zsh-4.3.10-7.el6.i686 1/1
Installed:
zsh.i686 0:4.3.10-7.el6
Complete!
#安装成功!实验完成!
好啦!可能描写的比较啰嗦,如有总结说明不妥的地方,还请各位见谅!谢谢!
RedHat 6.2 Linux修改yum源免费使用CentOS源