From where is the need for a local repository?
Let’s say we have 1000 VMs that need to be reinstalled via network or install critical patches; this will clog the WAN and take more time than you would expect. If you use the private repository you will benefit from the full speed and throughput of your internal network while flooding the wan for deltas only a few times a day.
Install createrepo
yum -y install createrepo
Install nginx for web access
yum -y install nginx
Set 'autoindex on'
for nginx in /etc/nginx/nginx.conf
Create directory structure
mkdir -p /usr/share/nginx/html/repo/centos/7/os/x86_64
Rsync repo from external source
cd /usr/share/nginx/html/repo/centos/7/os/x86_64 && \
rsync -avrz --progress rsync://mirrors.pidginhost.com/CentOS/7/updates/x86_64/* .
Optional : if repodata is missing
createrepo .
Point your yum.repos.d/*.repo
to your local ones
'yum clean all'
after repos were modified
Install your packages from the new created repository.