在公司内网中,可能无法连接外部网络,这时需要我们将外部yum源中的包克隆到本地
#在yum源服务器上 systemctl stop firewalld systemctl disable firewalld setenforce 0 yum install -y yum-utils epel-release yum install -y nginx createrepo vim /etc/nginx/nginx.conf
location / { root /usr/share/nginx/html; autoindex on; }
systemctl restart nginx reposync -r base rm -rf /usr/share/nginx/html/* mv base /usr/share/nginx/html/ cd /usr/share/nginx/html/ createrepo base/ #客户使用端 vim /etc/yum.repos.d/myrepo.repo
[myrepo] name=myrepo baseurl=http://nginx-server/base/ enabled=1 gpgcheck=0
yum clean all yum makecache