11、安装包组
yum groupinstall "GROUP NAME"
12、卸载包组
yum groupremove "GROUP NAME"
【自建yum仓库】
下面通过自建一个http服务器的yum仓库为例说明:
第一步:安装httpd程序并启动服务;
yum -y install httpd
service httpd start
chkconfig httpd on
12345678910111213141516171819202122232425262728293031323334353637 [root@CentOS6 yum.repos.d]# yum -y install httpd
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i686 0:2.2.15-29.el6.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
httpd i686 2.2.15-29.el6.centos c6-cd 828 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 828 k
Installed size: 2.8 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : httpd-2.2.15-29.el6.centos.i686 1/1
Verifying : httpd-2.2.15-29.el6.centos.i686 1/1
Installed:
httpd.i686 0:2.2.15-29.el6.centos
Complete!
[root@CentOS6 yum.repos.d]# service httpd start
Starting httpd: [ OK ]
[root@CentOS6 yum.repos.d]# chkconfig httpd on
[root@CentOS6 yum.repos.d]# chkconfig |grep httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
第二步:创建子目录,存放某相关的所有rpm包,httpd的文档根目录为/var/www/html;为仓库生成元数据文件(使用createrepo),以使能够作为仓库使用。
[root@CentOS6 html]# cd /var/www/html
[root@CentOS6 html]# mkdir test #创建test目录用来测试;
[root@CentOS6 html]# cp /mnt/cd/Packages/zsh-4.3.10-7.el6.i686.rpm ./test #复制zsh这个安装包到test目录;
[root@CentOS6 Packages]# yum install createrepo #安装createrepo,如提前已安装则不用再装;
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package createrepo.noarch 0:0.9.9-18.el6 will be installed
--> Processing Dependency: Python-deltarpm for package: createrepo-0.9.9-18.el6.noarch
--> Running transaction check
---> Package python-deltarpm.i686 0:3.5-0.5.20090913git.el6 will be installed
--> Processing Dependency: deltarpm = 3.5-0.5.20090913git.el6 for package: python-deltarpm-3.5-0.5.20090913git.el6.i686
--> Running transaction check
---> Package deltarpm.i686 0:3.5-0.5.20090913git.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================
Package Arch Version Repository Size
======================================================================
Installing:
createrepo noarch 0.9.9-18.el6 c6-cd 94 k
Installing for dependencies:
deltarpm i686 3.5-0.5.20090913git.el6 c6-cd 73 k
python-deltarpm i686 3.5-0.5.20090913git.el6 c6-cd 27 k
Transaction Summary
==========================================================================
Install 3 Package(s)
Total download size: 195 k
Installed size: 522 k
Is this ok [y/N]: y
Downloading Packages:
-----------------------------------------------------------------------------------------
Total 3.3 MB/s | 195 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : deltarpm-3.5-0.5.20090913git.el6.i686 1/3
Installing : python-deltarpm-3.5-0.5.20090913git.el6.i686 2/3
Installing : createrepo-0.9.9-18.el6.noarch 3/3
Verifying : createrepo-0.9.9-18.el6.noarch 1/3
Verifying : python-deltarpm-3.5-0.5.20090913git.el6.i686 2/3
Verifying : deltarpm-3.5-0.5.20090913git.el6.i686 3/3
Installed:
createrepo.noarch 0:0.9.9-18.el6
Dependency Installed:
deltarpm.i686 0:3.5-0.5.20090913git.el6
python-deltarpm.i686 0:3.5-0.5.20090913git.el6
Complete! #createrepo安装完成
[root@CentOS6 Packages]# createrepo /var/www/html/test/ #创建元数据文件;
Spawning worker 0 with 1 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@CentOS6 Packages]# ls /var/www/html/test/
repodata zsh-4.3.10-7.el6.i686.rpm #repodata即为刚刚创建出来存放元数据文件的目录;
[root@CentOS6 test]# ls /var/www/html/test/repodata/ #查看repodata下的元数据文件;
105b962a2624ebddd589ec03c1e4fdcd7a3511ea1e47fd80eeda364b41d48cdd-primary.sqlite.bz2
7762e79a7341d1b6a929e893fd732302dd27499742abf4549130601465760426-filelists.xml.gz
78f72a947bd046641a5ea0574872212cfe829f1525ff74f1d13f4da3c4d73cde-filelists.sqlite.bz2
7e8d7b7938dbd28a823ebe27420f3c2d088f9a1933f37319e925295e24417009-other.sqlite.bz2
885867e505b55bc3f09fb4eec3bc7cf8a5352cce29c307e7b37afaa38e3d33cc-primary.xml.gz
e0eb2191ed5de3b3975bbb005a00e07a044d5724b87373d4a6cdf399ff99bf3f-other.xml.gz
#通过以上几步一个简单的yum仓库就搭建好了!