Linux, Windows, Virtualization, OpenSource & Blogging

Configure Local YUM Repository on CentOS 6 / RHEL 6

0

YUM is the Linux package management tool that help to install or update the packages, it does automatic installation of dependent packages which is required by main installation package. To setup the YUM repository we need ( For testing purpose ) one server system where all the packages are hosted and the client system where you want to install or update the packages.

Hosting Packages

Client must have to communicate through any one type of medium to get the packages from server system, Normally server uses FTP or Apache as the medium to transfer the packages. From the above hosting the packages depend on the services we used, we need to copy those downloaded packages on to /var/ftp or /var/www/html receptively for FTP and Apache. You can use either FTP or Apache.

Mount the DVD on the /cdrom

mkdir cdrom;mount /dev/cdrom /cdrom

FTP

copy the packages from the DVD to FTP folder.

cp /cdrom/Packages/* /var/ftp

Apache

copy the packages from the DVD to apache home directory.

cp /cdrom/Packages/* /var/www/html/

Edit Apache configuration file to enable the indexes.

vi /etc/httpd/conf/httpd.conf

From

Options Indexes FollowSymLinks

To

Options All Indexes FollowSymLinks

Remove the welcome page.

rm -rf /etc/httpd/conf.d/welcome.conf

Verify the above using the web browser by visiting ftp://ip-address or http://ip-address.

Creating Repository

After hosting the packages, we need to create the repository of the packages that you have download from internet or copied from the disc. CreateRepo is the tool that help you to create the XML based rpm meta structure repository, It is like an index file that point to the rpm files. This XML files used for resolving the dependency packages which is required by main package.Install CreateRepo package.

rpm -Uvh deltarpm-**.el6.x86_64.rpm python-deltarpm-**.el6.x86_64.rpm createrepo-**.rpm

FTP

createrepo /var/ftp

Apache

createrepo /var/www/html

Configure Repository

Once created the repository, just go on to the client machine and add the repository file under the /etc/yum.repos.d directory. Change ipadress to your server ip address..

vi /etc/yum.repos.d/remote.repo

FTP

[remote]
name=RHEL FTP
baseurl=ftp://192.168.0.151
enabled=1
gpgcheck=0

Appache

[remote]
name=RHEL Apache
baseurl=http://192.168.0.151
enabled=1
gpgcheck=0

Install Packages

Install the packages using the yum command. Once the command issued, it downloads meta file from the server and look for the dependent rpm if required; otherwise it will install package automatically.
yum install mysql-server

Conclusion

From the above you could see the MySQL Server packages installed with all dependent packages, It performs the same task that RPM can. It provides a easy installation of packages in single command line. If you face any problem on FTP or Apache, do disabling the iptables.

POSTS YOU MAY LIKE -:)

You might also like

Configure Local YUM Repository on CentOS 6 / RHEL 6

0