Configure YUM Repository On Linux

0

YUM is the Linux package manager that is able to fetch the information about the available package, download the package,install,uninstall and update the package. It also help us to update the system when the update is available. YUM is very similar to the rpm command, it is more smarter than rpm because it does the automatic installation of dependent package required by the installation package. YUM can be configured with new,additional or updating the source of the package and package can be installed using trusted repository source only. Trusted repository meant that source repository comes with the verified the gpg keys which can be enabled in the repository configuration file, if the gpg key does not match with the repository key YUM will not install the package.

Configuration:

YUM configuration files can be found on /etc directory.  /etc/yum.conf  is the main global file, it contains the information of cache directory, log file, debug info,etc…

[main]cachedir=/var/cache/yum/$basearch/$releasever

keepcache=0

debuglevel=2

logfile=/var/log/yum.log

exactarch=1

obsoletes=1

gpgcheck=1

plugins=1

installonly_limit=3

# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo

# in /etc/yum.repos.d

where as /etc/yum.conf.d directory contains additional repository source files. If you need to setup any new repository, here you have to start by creating the repo file ending with .repo extension. Here is the small tutorial which help you to setup the yum repository for your local network installation, before creating the repo you need to have the some information about source which contains rpm packages and xml ( RPM index) file.

The typical repo file will look like below.

[epel]name=Extra Packages for Enterprise Linux 6 – $basearch baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

From the above you can you can see [epel] is the unique section name which contains the repository information

1. name=Extra Packages for Enterprise Linux 6 – $basearch – Name of the repository

2. baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch – it is the url where the repository localted, it can be http,ftp or local file ( http:/path/to/repo, ftp://path/to/repo, file:///path/to/rep respectively).

3. enabled – Enable or disable the repository

4. gpgcheck – Enable or Disable the gpg check

5. gpgkey = Location of the gpg key if you have enabled the gpg check option above.

Verification:

Once you have finished off the configuration, just enter the following command to verify the configuration file. epel refers the name of the section.

yum-config-manager epel ****gpgcadir = /var/lib/yum/repos/x86_64/6Server/epel/gpgcadir

gpgcakey =

gpgcheck = True

gpgdir = /var/lib/yum/repos/x86_64/6Server/epel/gpgdir

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

hdrdir = /var/cache/yum/x86_64/6Server/epel/headers

http_caching = all

includepkgs =

********

Installation:

Use the following command to install the package. To test the new repository,  install the MySQL package

yum install mysql-server

Loaded plugins: product-id, refresh-packagekit, security, subscription-

: manager

Updating certificate-based repositories.

Unable to read consumer identity

Setting up Install Process

Resolving Dependencies

–> Running transaction check

—> Package mysql-server.x86_64 0:5.1.61-4.el6 will be installed

–> Processing Dependency: mysql = 5.1.61-4.el6 for package: mysql-server                                                                                    -5.1.61-4.el6.x86_64

–> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.6                                                                                    1-4.el6.x86_64

–> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bi                                                                                    t) for package: mysql-server-5.1.61-4.el6.x86_64

–> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit)                                                                                     for package: mysql-server-5.1.61-4.el6.x86_64

–> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: m                                                                                    ysql-server-5.1.61-4.el6.x86_64

–> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mys                                                                                    ql-server-5.1.61-4.el6.x86_64

–> Running transaction check

—> Package mysql.x86_64 0:5.1.61-4.el6 will be installed

—> Package mysql-libs.x86_64 0:5.1.61-4.el6 will be installed

—> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed

–> Finished Dependency ResolutionDependencies Resolved

=========================================================================

Package              Arch         Version              Repository  Size

=========================================================================

Installing:

mysql-server         x86_64       5.1.61-4.el6         rhel       8.6 M

Installing for dependencies:

mysql                x86_64       5.1.61-4.el6         rhel       882 k

mysql-libs           x86_64       5.1.61-4.el6         rhel       1.2 M

perl-DBD-MySQL       x86_64       4.013-3.el6          rhel       134 k

Transaction Summary

=========================================================================

Install       4 Package(s)

Total download size: 11 M

Installed size: 31 M

Is this ok [y/N]: y

Downloading Packages:

————————————————————————-

Total                                     63 MB/s |  11 MB     00:00

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : mysql-libs-5.1.61-4.el6.x86_64                        1/4

Installing : perl-DBD-MySQL-4.013-3.el6.x86_64                     2/4

Installing : mysql-5.1.61-4.el6.x86_64                             3/4

Installing : mysql-server-5.1.61-4.el6.x86_64                                                                                                          4/4

Installed products updated.

Verifying  : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                                                         1/4

Verifying  : mysql-libs-5.1.61-4.el6.x86_64                                                                                                            2/4

Verifying  : mysql-server-5.1.61-4.el6.x86_64                                                                                                          3/4

Verifying  : mysql-5.1.61-4.el6.x86_64                                                                                                                 4/4

Installed:

mysql-server.x86_64 0:5.1.61-4.el6

Dependency Installed:

mysql.x86_64 0:5.1.61-4.el6                    mysql-libs.x86_64 0:5.1.61-4.el6                    perl-DBD-MySQL.x86_64 0:4.013-3.el6

Complete!

Conclusion:

From the above you could see the MySQL server package’s installed with it’s dependent. Installation as simple as watching movies, just enter the command and watch drama of the installation. 

Search Term:

Install YUM

YUM Configuration

Configure YUM

Configure YUM under Linux

Configure YUM on the Linux

Configure YUM on CentOS

Configure YUM on RHEL

Configure YUM on CentOS 5

Configure YUM on CentOS 6

Configre YUM on RHEL 6

Cnfigure YUM on RHEL 5

YUM Configuration

YUM setup

Setup YUM on CentOS 6

Setup YUM on Linux


You might also like