RHEL7: Create a local repository.
Configuration Procedure
Create a directory for the RHEL 7 distribution:
# mkdir -p /var/www/html/rhel7
Note: By creating the local repository in the /var/www/html directory, you will be ready to make it available on the network after installing an Apache webserver at a later stage.
Mount the previously downloaded Rhel 7 distribution (called here rhel-workstation-7.1-x86_64-dvd.iso) and copy it locally:
# mount -o loop rhel-workstation-7.1-x86_64-dvd.iso /mnt # cd /mnt # tar cvf - . | (cd /var/www/html/rhel7; tar xvf -) # cd /; umount /mnt
Go to the directory where the repository configuration is:
# cd /etc/yum.repo.d
Create the rhel7.repo file and type:
[rhel7]
name=rhel7
baseurl=file:///var/www/html/rhel7/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rhel-7
Clean up the yum configuration and check it:
# yum clean all # yum repolist all
If you regularly add new packages in your local repository, don’t forget to update it. To do that, install the createrepo package and execute it with the repository path as argument:
# yum install -y createrepo # createrepo /var/www/html/rhel7 # yum clean all # yum repolist all
No comments:
Post a Comment