Setup Local Repository CentOS 7
Setup Local Repository CentOS 7
Setup Local Repository CentOS 7
Next install vsftpd package and let the packages available over FTP to your local
clients.
# cd /mnt/Packages/
# rpm -ivh vsftpd-3.0.2-9.el7.x86_64.rpm
# systemctl enable vsftpd
# systemctl start vsftpd
Next install httpd package and let the packages available over HTTP to your local
clients.
# yum install httpd
# systemctl enable httpd
# systemctl start httpd
If you did a minimal CentOS installation, then you might need to install the
following dependencies first:
# rpm -ivh libxml2-python-2.9.1-5.el7.x86_64.rpm
# rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm
# rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm
After that, you can install packages only from the local repository by mentioning
the repository as shown below.
# yum install --disablerepo="*" --enablerepo="localrepo" ntp
[base]
name=CentOS-$releasever - Base
baseurl=http://172.13.21.37/centos/7/7/
gpgcheck=0
[updates]
name=CentOS-$releasever - Updates
baseurl=http://172.13.21.37/centos/7/updates/x86_64/
gpgcheck=0
# yum repolist
# yum clean all
# yum update
# yum install --disablerepo="*" --enablerepo="localrepo" httpd
======================================================================
[base]
name=CentOS-$releasever - Base
baseurl=http://172.13.21.37/centos/7/7/
gpgcheck=0
[updates]
name=CentOS-$releasever - Updates
baseurl=http://172.13.21.37/centos/7/updates/x86_64/
gpgcheck=0
==============================================================
#!/bin/bash
echo "Running Rsync CentOS 7 Repository!"
/usr/bin/rsync -avz --delete --exclude='repo*'
rsync://mirrors.viethosting.com/centos/7/os/x86_64/ /var/www/html/centos/7/7
>/dev/null
/usr/bin/rsync -avz --delete --exclude='repo*'
rsync://mirrors.viethosting.com/centos/7/updates/x86_64/
/var/www/html/centos/7/updates/x86_64 >/dev/null
echo -e "\n"
echo "Running Rsync CentOS 6 Repository!"
/usr/bin/rsync -avz --delete --exclude='repo*'
rsync://mirrors.viethosting.com/centos/6/os/x86_64/ /var/www/html/centos/6/6
>/dev/null
/usr/bin/rsync -avz --delete --exclude='repo*'
rsync://mirrors.viethosting.com/centos/6/updates/x86_64/
/var/www/html/centos/6/updates >/dev/null
echo -e "\n"