YUM configuration in Linux

YUM is Yellow dog Updated Modified. It is developed to maintain RPM based system. RPM is Redhat Package Manager. YUM is a package manager with below features –
  1. Simple install, un-install, upgrade operations
  2. Automatic resolves software dependency
  3. Looks for more than one source for software
  4. Supports CLI and GUI
  5. Automatically detects architecture of system and search for best fit software version
  6. Works well with remote (network connectivity) and local (without network connectivity) repositories.
All these features made it best package manager. In this article we will walk through Yum configuration steps. You can also browse through below yum related posts :

YUM configuration basics

Yum configuration has repositories defined. Repositories are the places where package files .rpm are located and yum searches, downloads files from repositories for installations. Repositories can be local mount point file://path, remote ftp location ftp://link, http location link http://link or http://login:password@link, https link or remote NFS mount point.
Yum configuration file is /etc/yum.conf and repository configuration files are located under /etc/yum.repos.d/ directory. All repository configuration files must have .repo extension so than yum can identify them and read their configurations.
Typical repo configuration file entry looks like below :
here –
  • [rhrl-source-beta] is unique repository id.
  • name is human readable repository name
  • baseurl is location from where packages should be scanned and fetched
  • enabled denotes if this repo is enabled or not i.e. yum should use it or not
  • gpgcheck enable/disable GPG signature check
  • gpgkey is location of GPG key
Out of these first 4 entries are mandatory for every repo location. Lets see how to create repo from DVD ISO file.
Remember one repo configuration file can have more than one locations listed.

YUM repo configuration for DVD ISO

RPM based Linux installation DVD has RPM files in it which are used to install packages at time of OS installation. We can use these package and build our repo so that yum can use those packages!
First you have to mount ISO file on system. Lets assume we have mounted it on /mnt/dvdNow we have to create yum repo file for it. Lets create file dvdiso.repo under /etc/yum.repos.d/ directory. It should looks like :
Thats it! Your repo is ready. You can check using yum repolist command.
In above output you can see repo is identified by yum. Now you can try installation any software from it with yum install command.
Make sure your ISO is always mounted on system even after reboot (add entry in /etc/fstab to run this repo successfully.

YUM repo configuration for http repo

There are many official and un-official repositories are hosted on internet and can be accessed over http protocol. These repositories are large and may contains more packages than your DVD has. To use them in yum, your server should have active internet connection and it should be able to connect with http locations you are trying to configure.
Once connectivity is confirmed create new repo file for them e.g. named weblocations.repo under directory /etc/yum.repos.d/ with content as below (for example) :
In above example you can see 2 web locations are configured in repo. First is http for centOS whereas second one is RHEL supplied with https mirror list. Since https protocol is used other SSL realted config can be seen following it.
Time to check repo –
Both repo are identified by yum. Configuration is successful.
Read about yum server configuration for ftp, http and client side yum configuration in our other articles.
SHARE

sangeethakumar

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment