同步yum源到本地
https://www.cnblogs.com/xiaozhang1995/p/18147995
yum -y install createrepo yum-utils httpd net-tools reposync
创建同步目录
mkdir -p /var/www/html/yum/
开始同步
reposync -p /var/www/html/yum/
ls /var/www/html/yum/
base extras repo updates
#生成repodata,在同步下来的每一个yum仓库目录都需要执行。
createrepo -p /var/www/html/yum/extras/
createrepo -p /var/www/html/yum/updates/
ls /var/www/html/yum/updates/
Packages repodata
vim /etc/yum.repos.d/local.repo
[updates]
name=CentOS-$releasever - Updates
#baseurl 为 repodata 目录所在的目录
#baseurl=http://10.2xxx.xxx.xxx/yum/updates/
baseurl=file:///var/www/html/yum/updates/
gpgcheck=0
enabled=1
httpd配置
mkdir /var/www/html/yum
<VirtualHost *:80>
RewriteEngine On
RewriteRule ^/$ /yum [L,R=301]
</VirtualHost>