公司只有一台内网机器
1.准备rpm包
下载最新的bin-DVD的系统镜像:
http://mirror.bit.edu.cn/centos/(暂且就用北理的镜像站了)
把DVD1和DVD2.iso都下载下来
mkdir -p /centos_dvd1
mount -o loop CentOS-6.5-x86_64-bin-DVD1.iso /centos_dvd1/
2.nginx配置
server { listen 55555; root /centos_dvd1; location / { root /centos_dvd1; index index.html index.htm; autoindex on; autoindex_exact_size off; autoindex_localtime on; } }
3.访问centos源
http://127.0.0.1:12345/
4.客户端软件源配置文件:
cd /etc/yum.repos.d/ cp CentOS-Base.repo CentOS-Base.repo.bak
vi CentOS-Base.repo
CentOS-Base.repo文件修改之后如下:
[base] name=CentOS-$releasever - Base baseurl=http://192.168.1.101:12345/centos-6/ gpgcheck=1 gpgkey=http://192.168.1.101:12345/RPM-GPG-KEY-CentOS-6 enabled=1