将ISO镜像传到服务器上 如/root目录(目录自己选择)
mkdir /root/iso 创建挂载目录
mount -o loop
/root/CentOS-6.6-x86_64-bin-DVD1.iso /root/iso/ 挂载镜像文件
cd /etc/yum.repo.d
rename .repo .repo.bak * 本分yum 文件
添加 本地yum源
vim centos-local.repo
[base]
name=CentOS-local – Base
baseurl=file:///root/iso
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
:wq
yum clean all 清空yum源
yum repolist all 查看yum源
用本地yum安装软件
yum -y install httpd
yum -y install createrepo
到此本地源已经创建完成
下面开始创建网络yum源/或者局域网源(第一服务器是连接网络的)
将packages包拷贝到htppd默认服务路径
cp -r /root/iso/Packages/ /var/www/html/centos6.5/
关闭防火墙
service iptables stop
chkconfig iptables off
启动httpd服务
service httpd start
chkconfig httpd on
检验 httpd是否启动正常
网页访问
http://localhost/centos6.5/Packages/
cd /var/www/html/centos6.5/Packagees
开始制作repodata数据 :createrepo . (注意 .)
完成后
yum clean all
yum repolist all
到此网络yum源制作完成
如果有机器要使用这个yum源的安装包 只要修改新建一个repo文件 将里面的baseurl 改为http://yun源地址/centos6.5/Packages/ 即可
如:[base]
name=CentOS-$releasever – Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://192.168.169.144/centos6.5/Packages/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


















暂无评论内容