Page 107 - RHEL8 BOOK
P. 107

Step # 1: Create a repository at server side where all rpms are copied
          [root@sun ~]#mount  /dev/sr0 /mnt
          [root@sun ~]#cd   /mnt
          [root@sun ~]#cd Packages
          [root@sun ~]#rpm –ivh  vsftpd*
          [root@sun ~]#rpm –ivh  createrepo*
          [root@sun ~]#cp –rvf *   Packages    /var/ftp/pub/

          Step # 2: Remove the old data
          [root@sun ~]#cd   /var/ftp/pub/Packages
          [root@sun ~]#rm –rf  repodata

          Step # 3: Create a repository
          Use createrepo to generate the necessary XML metadata. Type the following commands:
          [root@sun ~]# cd /mnt
          [root@sun ~]# cp –r repodata /var/ftp/pub
          [root@sun ~]# cp –r 76a1…………………………………..xml /var/ftp/pub
          [root@sun ~]# createrepo –g /mnt/repodata/76a1…………….comps-Server.x86_64.xml
                 /var/ftp/pub/Packages
          1 /4323
          Step # 4: List your new repos
          [root@sun ~]# yum repolist
          [root@sun ~]# yum clean all         //
          [root@sun ~]# yum update

          Step # 5: Create config file in RHEL8

          [rot@sun ~]# vi /etc/yum.repos.d/iso.repo
          [LocalBaseOS]
          name=BaseOS
          baseurl=file:///var/ftp/pub/BaseOS
          enabled=1
          gpgcheck=0

          [LocalAppStream]
          name=AppStream
          baseurl=file:///var/ftp/pub/AppStream
          enabled=1
          gpgcheck=0
          or
          [RHEL7]
          name=RHEL7
          baseurl=ftp://192.168.1.1/pub/Packages
          enabled=1
          gpgcheck=1
          gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

          Step # 6: To install a package
          [root@sun ~]#yum install samba*


                                                       S. Pradhan
                             (MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
                                             Email Id:-spradhan.iiht@gmail.com
                                                           107
   102   103   104   105   106   107   108   109   110   111   112