Simplest Enterprise Continuous Integration Solutions

Saturday, August 17, 2013

Enterprise Linux: Use YUM Groups command

How to use yum group commands:

grouplist
groupinfo
groupinstall
groupremove
groupupdate


How to configure own YUM group in own repository for yum groups command

1. yum-groups-manager command execution, for example, DEMO 3.0.0

[root@linux64-app-server ~]# yum-groups-manager -n "DEMO 3.0.0" --id=demo3.0.0 --save=demo3.0.0.xml --mandatory demo-core demo-application
[root@linux64-app-server ~]# cat demo3.0.0.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE comps PUBLIC "-//Red Hat, Inc.//DTD Comps info//EN" "comps.dtd">
<comps>

  <group>
   <id>demo3.0.0</id>
   <default>false</default>
   <uservisible>true</uservisible>
   <display_order>1024</display_order>
   <name>DEMO 3.0.0</name>
   <description></description>
    <packagelist>
      <packagereq type="mandatory">demo-core</packagereq>
      <packagereq type="mandatory">demo-application</packagereq>
    </packagelist>
  </group>
</comps>

2. createrepo command execution with demo3.0.0.xml yum group file

[root@linux64-app-server ~]# createrepo -g /root/demo3.0.0.xml --update /var/www/html/demo-repo/el/6


2.1 repodata with group file looks like

[root@linux64-app-server ~]# find /var/www/html/demo-repo/el/6/repodata
/var/www/html/demo-repo/el/6/repodata
/var/www/html/demo-repo/el/6/repodata/9c6c9a5c272f1dc5b8b0600da36b221c2f3ba27534947ac85dda74ead3fc1932-demo3.0.0.xml
/var/www/html/demo-repo/el/6/repodata/294ee3556b87cc20d28047c46a61b20f17423bd5ffe06869bd625613dff49c68-filelists.sqlite.bz2
/var/www/html/demo-repo/el/6/repodata/repomd.xml
/var/www/html/demo-repo/el/6/repodata/653d4aa8c51772f506dd805d3a2cf3ce645875d871b32324cadff15afeda3751-demo3.0.0.xml.gz
/var/www/html/demo-repo/el/6/repodata/6be82151e5dc44e9d520883151e60356a6c5c93619595578231330aa49467ab3-filelists.xml.gz
/var/www/html/demo-repo/el/6/repodata/3edf95b23750b20e9707e8b4fe247355fd516475655a8f355cf1f1dcdd8cdc70-primary.xml.gz
/var/www/html/demo-repo/el/6/repodata/c0225427874c49ca6cd5f285c40686e487cf30e8327b7e0f95e860724ce8763d-other.xml.gz
/var/www/html/demo-repo/el/6/repodata/3331bfd414bb08c33c26adf51c209d8a9b2c0403821f514bfe4cc1c9560022c3-primary.sqlite.bz2
/var/www/html/demo-repo/el/6/repodata/3d9422756573f00068b6cee6281aec9985775f82abd91f75070c7a2cf7c7549c-other.sqlite.bz2

3. demo-repo.repo file looks like

[root@linux64-app-server ~]# cat /etc/yum.repos.d/demo-repo.repo
[demo-repo]
name=(local yum repo of) DEMO-REPO
baseurl=http://<YUM-REPO-Server>/demo-repo/el/6
enabled=1
gpgcheck=0

4. yum grouplist, yum groupinfo command execution, for example, DEMO 3.0.0

[root@linux64-app-server ~]# yum grouplist | grep DEMO
   DEMO 3.0.0
[root@linux64-app-server ~]#  yum groupinfo "DEMO 3.0.0"
Loaded plugins: security
Setting up Group Process

Group: DEMO 3.0.0
Mandatory Packages:
   demo-core
   demo-application

5. yum groupinstall command execution, for example, DEMO 3.0.0

[root@linux64-app-server ~]# yum groupinstall "DEMO 3.0.0"
Loaded plugins: security
Setting up Group Process
Resolving Dependencies
--> Running transaction check
---> Package demo-core.x86_64 0:3.0.0-19683 will be installed
---> Package demo-application.noarch 0:3.0.0-21746 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================
Package                                                  Arch              Version                                   Repository            Size
=================================================================================================================================================
Installing:
demo-core                                                x86_64            3.0.0-19683                               demo-repo             87 M
demo-application                                         noarch            3.0.0-21746                               demo-repo             25 M

Transaction Summary
=================================================================================================================================================
Install       2 Package(s)

Total download size: 112 M
Installed size: 197 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): demo-core-3.0.0-19683.x86_64.rpm                                                                                   |  87 MB     00:01
(2/2): demo-application-3.0.0-21746.noarch.rpm                                                                            |  25 MB     00:00
-------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                             65 MB/s | 112 MB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : demo-application-3.0.0-21746.noarch                                                                    1/2
  Installing : demo-core-3.0.0-19683.x86_64                                                                           2/2
  Verifying  : demo-application-3.0.0-21746.noarch                                                                    1/2
  Verifying  : demo-core-3.0.0-19683.x86_64                                                                           2/2

Installed:
  demo-core.x86_64 0:3.0.0-19683    demo-application.noarch 0:3.0.0-21746

Complete!

6. yum groupremove command execution, for example, DEMO 3.0.0

[root@linux64-app-server ~]# yum groupremove "DEMO 3.0.0"
Loaded plugins: security
Setting up Group Process
Resolving Dependencies
--> Running transaction check
---> Package demo-core.x86_64 0:3.0.0-19683 will be erased
---> Package demo-application.noarch 0:3.0.0-21746 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================
Package                                                  Arch              Version                                  Repository             Size
=================================================================================================================================================
Removing:
demo-core                                               x86_64             3.0.0-19683                              @demo-repo            168 M
demo-application                                        noarch             3.0.0-21746                              @demo-repo             29 M

Transaction Summary
=================================================================================================================================================
Remove        2 Package(s)

Installed size: 197 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : demo-core-3.0.0-19683.x86_64                                                                           1/2
  Erasing    : demo-application-3.0.0-21746.noarch                                                                    2/2
  Verifying  : demo-application-3.0.0-21746.noarch                                                                    1/2
  Verifying  : demo-core-3.0.0-19683.x86_64                                                                           2/2

Removed:
  demo-core.x86_64 0:3.0.0-19683    demo-application.noarch 0:3.0.0-21746

Complete!

7. yum groupremove command execution, for example, DEMO 3.0.0

[root@linux64-app-server ~]# yum groupupdate "DEMO 3.0.0"
Loaded plugins: security
Setting up Group Process
Package demo-core-3.0.0-19683.x86_64 already installed and latest version
Package demo-application-3.0.0-21746.noarch already installed and latest version
Warning: Group demo3.0.0 does not have any packages.
No packages in any requested group available to install or update

No comments:

Post a Comment