In certain circumstances it may be advisable to have a local repository server for updating and installing packages on Red Hat or derived systems.
The first thing we have to do is install the necessary software:
Bash
yum install yum-utils createrepo httpdOnce installed we proceed to create the repository
text
reposync –gpgcheck -l –repoid=rhel-7-server-rpms –download_path=/var/www/html –downloadcomps –download-metadata
createrepo -v /var/www/html/rhel-7-server-rpms -g comps.xmlWe configure the repository in our client
config
cat /etrc/yum.repos.d/repositoryloca.repo
[local-repo-rhel7]
metadata_expire = 86400
baseurl = http://192.168.1.134/rhel-7-server-rpms/
name = Local Repository for RHEL 7
enabled = 1
gpgcheck = 0We clear the cache
Bash
yum clean allWe can now install or update our operating system
Bash
yum –disablerepo=\* –enablerepo=local-repo-rhel7 update -yAll the best
:wq!
Comments