Build a local lan yum source using CentOS
#1. Mount CentOS-6.5-x86_64-bin-DVD1.iso first
mount
-oloop-tiso9660
/dev/cdrom
/mnt/
rpm-Uvh
/mnt/Packages/createrepo-0
.9.9-18.el6.noarch.rpm
mkdir
-p
/data/www/centos/6/x86_64/
\
cp
-r
/mnt/Packages/
/data/www/centos/6/x86_64/
cp
/mnt/RPM-GPG-KEY-CentOS-
*
/data/www/centos/
umount
/mnt
#2. Mount CentOS-6.5-x86_64-bin-DVD2.iso
mount
-oloop-tiso9660
/dev/cdrom
/mnt/
\
cp
-r
/mnt/Packages/
/data/www/centos/6/x86_64/
umount
/mnt
#3. Create a repository
createrepo
/data/www/centos/6/x86_64/
#4. Start nginx
cat
>
/etc/nginx/conf
.d
/yum
.repo.conf<<EOF
server{
listen80;
server_namelocalhost;
root
/data/www
;
# Enable Nginx directory file list
autoindexon;
autoindex_exact_sizeoff;
autoindex_localtimeon;
}
EOF
chmod
755
/data
chown
-Rnginx.
/data/www
servicenginxstart
chkconfignginxon
# Test Access: http: // 192.168.20.210/centos/6/x86_64/
#5. yum source configuration
cd
/etc/yum
.repos.d
mv
CentOS-Base.repoCentOS-Base.repo.bak
cat
>CentOS-Base.repo<<
'EOF'
[base]
name=CentOS-6-Base-LAN
baseurl=http:
//192
.168.20.210
/centos/6/
$basearch/
gpgcheck=1
gpgkey=http:
//192
.168.20.210
/centos/RPM-GPG-KEY-CentOS-6
EOF
#6. Verify
yumcleanall
yummakecache