rhel/centos: create local repos¶
- Title:
rhel/centos: create local repos
- Author:
Douglas O’Leary <dkoleary@olearycomputers.com>
- Description:
How to create local repos
- Date created:
11/2013
- Date updated:
11/2013
- Disclaimer:
Standard: Use the information that follows at your own risk. If you screw up a system, don’t blame it on me…
The normal patching cycle is to patch dev, then QA, and then production moving to the next level after a suite of tests and a burn in period. If you’re using the vendor patch suite, you can’t guarantee that the patches that were installed on dev are the ones that are being installed in production as patches get added every day.
I understand there are a number of potential options to circumvent this; one of them is listed below: creating your own patch repositories.
There are also a number of ways to access the new patch repo from other systems on your network. The process below uses ftp.
Install yum downloadonly, createrepo, and vsftpd, if not already done:
yum -y install yum-downloadonly createrepo vsftpd
Download the updates to a patch directory. Update directory name as needed.:
mkdir -p -m 755 /ignite/repos yum --downloadonly --downloaddir /ignite/repos update
Create the local repo:
createrepo /ignite/repos
Create the yum repository file. Update IP and directory names as needed:
# cat backup/local.repo [local] name=local baseurl=ftp://192.168.122.2/pub/repos enabled=1 gpgcheck=0
OS maintenance:
Enable vsftpd:
chkconfig vsftpd on service vsftpd start
Bind remount repos directory:
mkdir -p -m 755 /var/ftp/pub/repos mount -bind /ignite/repos /var/ftp/pub/repos
Set selinux context:
chcon -R -t public_content_t /ignite/repos
Update firewall, if required.
Test with elinks:
elinks ftp://localhost/pub/repos
andyum repolist
Initiate your patching cycle.