1、修改http的端口
vi /etc/httpd/conf/httpd.conf
#修改LISTEN 端口19999(指定一个即可,不一定是19999)
LISTEN 19999
2、当前先挂载该镜像文件
# 创建目录
mkdir /var/www/html/centos72
mkdir /opt/centos72/
# 挂载
mount /opt/CentOS-7-x86_64-Everything-1511.iso /var/www/html/centos72
mount /opt/CentOS-7-x86_64-Everything-1511.iso /opt/centos72/
3、修改启动项
vi /etc/rc.local
#添加以下内容
mount /opt/CentOS-7-x86_64-Everything-1511.iso /var/www/html/centos72
mount /opt/CentOS-7-x86_64-Everything-1511.iso /opt/centos72/
service httpd stop
service httpd start
vi /etc/yum.repos.d/local.repo
# 本地配置方式:
[base] ————[ ] 内为仓库名字
name=CentOS-$releasever - Base ————仓库的描述
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=file:///opt/centos72 ————仓库位置
enabled=1 ——————是否启用仓库,1启用,0不启用
gpgcheck=0 ————–是否检查gpg签名
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 —————gpgkey存放位置
# 客户端配置方式:
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://10.35.11.216:19999/centos72
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
使用yum install前,最好yum clean all 清除客户端之前的YUM缓存