centos搭建yum局域网源

公司只有一台内网机器

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值