Thursday, August 11, 2016

.::: How to Setting Local Repository RHEL/Redhat/Centos from ISO file :::

after we know about linux, sometimes we must know where location the package installer it’s. this time we will discuss about how to setting local repository, what is the repository? repository is a group of linux installer package that stored in a server that can be accessed via Internet or intranet, now how about someone who want install package and they don’t have internet connection. for detail about repository will discussed later, now we will explain how to setting repository from cdrom . this is following step to setting local repository from ISO file :

1. copy iso file to /data/
    rhel-server-6.6-x86_64-dvd.iso
2. create directory /mnt
   # mkdir mnt
   # chmod -R 777 mnt
3.mounting ISO file to directory /mnt
   # mount -o loop rhel-server-6.6-x86_64-dvd.iso /mnt
4. Checking mounting disk
 # df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             173G   19G  146G  12% /
tmpfs                 6.9G  148K  6.9G   1% /dev/shm
/dev/sda1             190M   32M  149M  18% /boot
/data/rhel-server-6.6-x86_64-dvd.iso
                      3.6G  3.6G     0 100% /mnt
                     
5. backup yum.repos.d/rhel-source.repo
  # cp /etc/yum.repos.d/rhel-source.repo /etc/yum.repos.d/rhel-source.repo.ori

6. check before edit /etc/yum.repos.d/rhel-source.repo
   # cat /etc/yum.repos.d/rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
baseurl=file:///media/RHEL-6.6\ Server.x86_64
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@ramreporter data]# df -kh

7. change location baseurl
    baseurl=file:///mnt
8. check after edit /etc/yum.repos.d/rhel-source.repo
   # cat /etc/yum.repos.d/rhel-source.repo
# cat /etc/yum.repos.d/rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
#baseurl=file:///media/RHEL-6.6\ Server.x86_64
baseurl=file:///mnt
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

9. Clean all
# yum clean all
# subscription-manager clean
All local data removed

10. test setting repository is succed you can check with install nmap
 # yum install nmap

No comments:

Post a Comment

Popular Posts