Topics Summary

 

What is YUM and what is the use of YUM?

While installing the package using rpm command it asks for the dependencies. To install the packages along with their dependencies we need to configure yum.

 

How to Configure YUM?

1. Check for the packages related to YUM has installed or not

[root@sys2 ~]# rpm -qa | grep yum*
PackageKit-yum-0.5.8-21.el6.x86_64
keyutils-libs-1.4-4.el6.x86_64
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-plugin-security-1.1.30-14.el6.noarch
PackageKit-yum-plugin-0.5.8-21.el6.x86_64
yum-rhn-plugin-0.9.1-43.el6.noarch
yum-3.2.29-40.el6.noarch
yum-utils-1.1.30-14.el6.noarch
keyutils-1.4-4.el6.x86_64
ibus-sayura-1.2.99.20100209-3.el6.x86_64

 

The packages required to configure YUM are

libxml2-python*

Deltarpm*

Python-deltarpm*

Createrepo*

 

2. Install the above packages to configure YUM.

[root@sys1 Packages]# rpm -ivh libxml2-python*
warning: libxml2-python-2.7.6-8.el6_3.4.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
package libxml2-python-2.7.6-8.el6_3.4.x86_64 is already installed

[root@sys1 Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signa ture, key ID fd431d51: NOKEY
    Preparing... ########################################### [100%]
     1:deltarpm ########################################### [100%]

[root@sys1 Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
               Preparing... ########################################### [100%]
     1:python-deltarpm ########################################### [100%]

[root@sys2 Packages]# rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm
warning: createrepo-0.9.9-17.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
      Preparing... ########################################### [100%]
     1:createrepo ########################################### [100%]

 

3. Check whether the packages are installed or not.

[root@sys1 Packages]# rpm -qa deltarpm
deltarpm-3.5-0.5.20090913git.el6.x86_64
[root@sys1 Packages]# rpm -qa python-deltarpm
python-deltarpm-3.5-0.5.20090913git.el6.x86_64
[root@sys1 Packages]# rpm -qa createrepo
createrepo-0.9.9-17.el6.noarch

 

Mount the cdrom to /mnt directory by using the following command.

[root@sys1 /]# mount /dev/cdrom /mnt

 

4. Copy all packages to the /repository which is already created by us using the following command.

Maintain the 4 GB disk space.

[root@sys1 /]# cp -ar /mnt/* /repo

 

You can see the verbose like this

`/mnt/Packages/compiz-gnome-0.8.2-24.el6.x86_64.rpm' -> `/repo/compiz-gnome-0.8.2-24.el6.x86_64.rpm'
`/mnt/Packages/comps-extras-17.8-1.el6.noarch.rpm' -> `/repo/comps-extras-17.8-1.el6.noarch.rpm'
`/mnt/Packages/conman-0.2.5-2.4.el6.x86_64.rpm' -> `/repo/conman-0.2.5-2.4.el6.x86_64.rpm'
`/mnt/Packages/ConsoleKit-0.4.1-3.el6.x86_64.rpm' -> `/repo/ConsoleKit-0.4.1-3.el6.x86_64.rpm'
`/mnt/Packages/ConsoleKit-libs-0.4.1-3.el6.x86_64.rpm' -> `/repo/ConsoleKit-libs-0.4.1-3.el6.x86_64.rpm'
`/mnt/Packages/ConsoleKit-x11-0.4.1-3.el6.x86_64.rpm' -> `/repo/ConsoleKit-x11-0.4.1-3.el6.x86_64.rpm'
`/mnt/Packages/control-center-2.28.1-38.el6.i686.rpm' -> `/repo/control-center-2.28.1-38.el6.i686.rpm'
`/mnt/Packages/control-center-2.28.1-38.el6.x86_64.rpm' -> `/repo/control-center-2.28.1-38.el6.x86_64.rpm'

 

5. Now create a new repo file in the yum configuration directory that is ‘/etc/yum.repos.d’.

[root@sys1 /]# vi /etc/yum.repos.d/ithonors.repo
[ithonors-repo]---------------Any name
name=pkgstore-----------------Any name
baseurl=file:///repository----directory where packages are copied
enable=1
gpgcheck=0

 

6. Now create the repo for the copied packages.

[root@sys1 /]# createrepo -v /repo/
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Starting other db creation     :Mon Feb 1 14:06:45 2016
Ending other db creation       :Mon Feb 1 14:06:47 2016
Starting filelists db creation :Mon Feb 1 14:06:47 2016
Ending filelists db creation   :Mon Feb 1 14:06:53 2016
Starting primary db creation   :Mon Feb 1 14:06:53 2016
Ending primary db creation     :Mon Feb 1 14:06:56 2016
Sqlite DBs complete

 

7. Now yum is configured for local machine successfully. Test the yum as follows.

Clean previous updates.

[root@sys1 /]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: InstallMedia ithonors-repo
Cleaning up Everything

 

Update the new YUM repository.

[root@sys1 /]# yum update
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
ithonors-repo                                           | 2.9 kB 00:00 ...
ithonors-repo/primary_db                                | 3.1 MB 00:00 ...
Setting up Update Process
No Packages marked for Update

 

8. Check the packages using the following commands

# yum install package-name

[root@sys2 Packages]# yum install vsftpd
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-11.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================
Package       Arch          Version           Repository         Size
=================================================================
Installing:
vsftpd           x86_64      2.2.2-11.el6    ithonors-repo     151 k

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

Total download size: 151 k
Installed size           : 331 k
Is this ok [y/N]         : y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning  : RPMDB altered outside of yum.
Installing : vsftpd-2.2.2-11.el6.x86_64                                                                          1/1
Verifying : vsftpd-2.2.2-11.el6.x86_64                                                                          1/1

Installed :
vsftpd.x86_64 0:2.2.2-11.el6

Complete!

 

#yum remove package-name

[root@sys2 Packages]# yum remove vsftpd
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Existing lock /var/run/yum.pid: another copy is running as pid 4465.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 39 M RSS (354 MB VSZ)
Started: Mon Feb 1 19:23:17 2016 - 00:07 ago
State  : Sleeping, pid: 4465
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-11.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================
Package        Arch         Version            Repository          Size
===========================================================
Removing:
vsftpd             x86_64     2.2.2-11.el6    @ithonors-repo   331 k

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

Installed size   : 331 k
Is this ok [y/N] : y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing   : vsftpd-2.2.2-11.el6.x86_64                                                                   1/1
Verifying  : vsftpd-2.2.2-11.el6.x86_64                                                                  1/1

Removed :
vsftpd.x86_64 0:2.2.2-11.el6

Complete!

 

#yum update package-name