Friday, January 24, 2014

YUM Server and Client set up

 YUM - yellow dog update modifier

- It helps to install packages which resolves the dependencies automatically
- It can be configure on one server and point the location on the yum client set up file and use on multiple servers using ftp or http. FTP, HHTP

YUM server set up
For initial you can use ISO image or DVD to set it up.

1. Mount cd or ISO image.
# mount -o loop ISOpath /mnt        // for ISO image file
# mount /dev/cdrom /mnt            // for CD/DVD
# cd Packages

2. Install following packages.

# rpm -ivh createrepo+tab            // Date Repository
# rpm -vh deltarpm+tab                // solves Dependency
# rpm -ivh python-deltarpm+tab            // solves Dependency
 # rpm -ivh vsftpd+tab                // Folder created /var/ftp/pub

3. Copy CD/ISO image content
# cp -rfv * /var/ftp/pub
# cf /mnt/repodata

# cp 1a........xml /var/ftp/pub

4. Create a repo
# createrepo -vg /var/ftp/pub/1a......xml    // -vg - verbose group
# cd /etc/yum.repos.d

# rm -rf *                    // To remove previous existing answer files
# vim yum.repo
    home=My Custom Repository
    # baseurl=

How to configure yum repo?
i. A configuration file for each repository (or group of related repos) should be created in /etc/yum.repos.d/
ii. The name of each repo config file should end in “.repo”.
iii. Yum Repository Mandatory Configuration Items

a. Repository ID: Short name to identify this repository in reports

b. Name: Long description of this repository
 name=My Custom Repository

c. Baseurl: Description of protocol and location of packages to locate from the repo file.

d. gpgcheck: Defines whether yum should attempt to validate package signatures. “0? = “off”, “1? = “on”.

e. gpgkey: Defines (via URL) where the keys for signature validation are located
 (typically file:///etc/pki/rpm-gpg/<key name>)


f. enabled (Optional) Defines whether this repository should be currently active. “0? = “off”, “1? = “on”.

 # yum clean all  // To check
# yum list all             
# service vsftpd restart            // Restart FTP service
# chkconf vsftpd on

Setting up YUM Client

1. Install ftp package,
# yum install ftp -y
# cd /etc/yum.repos.d
# ls
# rm -rf *
# vim file.repo
    [Yum Client]
    baseurl=        // FTP server IP

Some yum commands

# yum install yum* -y
# yum ls            // list all the packages
# yum history            // list the history

To see Shortcut :

# cat /etc/yum/aliases.conf

To search for the install file :

# yum whatprovides crond

How to set up yum client for a single host without ftp or http

1. Get the OS image.
# mount -o loop ISOpath /mnt        // for ISO image file
# mount /dev/cdrom /mnt            // for CD/DVD

# cd /mnt
# mkdir /opt/yum
# cp -rvf . /opt/yum
# vim /etc/yum.repos.d/base.repo
  Insert mode
# yum update

No comments:

Post a Comment