Create Local YUM repository in RHEL7

Steps to create local YUM repository-----

Prerequisites-----

>Install RHEL 7 / CentOS Bit 64 OS on Physical / VM machine.
>Loging as a root to OS or use "su -" to switch root user.
>Need RHEL 7 / CentOS 7 Bit 64 media / .iso file.
>Disable iptables ( Process included in following document )
>Disable Selinux  ( Process included in following document )

YUM Installation and configuration steps-----

>Insert RHEL 7 Bit 64 DVD to dvd drive or map RHEL 7 .iso file to virtual media.

>Loging to OS with root user and go to directory /run/media/root
Command:- #cd /run/meida/root   ----- OS media mounted by default here.
                      #ls                              ----- Check OS installable directory
 Following is the the default RHEL 7 installation path.
                   

  
>Go to Packages directory and install createrepo and vsftpd packages.
Command:-#cd /run/media/root/RHEL-7.0 Server.x86_64/Packages ----- Go to Packages directory
                     #rpm -ivh createrepo-0.9.9-23.el7.noarch.rpm       ----- Install createrepo
                     #rpm -ivh vsftpd-3.0.2-9.el7.x86_64.rpm               ---- Install FTP server

                 
 >Create "rhel7" directory in /var/ftp/pub/
Command:-#mkdir /var/ftp/pub/rhel7     -----Create rhel7 directory in pub directory

>copy all the RHEL 7 OS installable to /var/ftp/pub/rhel7 directory
Command:-#cp -vr /run/media/root/RHEL-7.0 Server.x86_64/* /var/ftp/pub/rhel7/  ----- cp command will copy all the RHEL 7 DVD contains to /var/ftp/pub/rhel7 directory. Find the following screenshot.


>Create repolist on /var/ftp/pub/rhel7/ directory
Command:- #cd /var/ftp/pub/                           ----- Go to pub directory.
                     #createrepo --database ./rhel7       ----- Create repolist on rhel7 directory

>Go to /etc/yum.repos.d directory and create base.repo file.
Command:-#cd /etc/yum.repos.d                     ----- Go to yum.repos.d directory
                     #vim base.repo                              ----- create base.repo file

Put the following contains in base.repo file.


:wq         ------ Save the file and exit


>Disable Iptables
Command:- #systemctl stop iptables                 ----- Stop iptables service
                      #chkconfig iptables off                  ----- iptables service off permanently.

>Disable Selinux.
Command:- #cd /etc/selinux                             ------ Go to selinux directory
                     #vim config                                   ------ Edit config file
Disable selinux as per the following screenshot in config file.

:wq             ------ Save the file and exit

>Restart ftp server.
Command:-#systemctl restart vsftpd                                 ----- Restart ftp server
                    #chkconfig vsftpd on                                       ----- FTP service on permanently.

>Check YUM repository.
Command:- #yum repolist                                                  ----- Display repository list.


EOF





Comments

Popular posts from this blog

KVM Live Migration without Shared Storage

Create CentOS 6 Local package and Group package Repository

Create Linux ( LUCI ) Cluster