1.挂载系统盘或系统镜像文件
mount /dev/cdrom /media
or
mount -o loop centos6-xxx.iso /mnt

2.创建仓库
mkdir /centos-local-repo

3.拷贝软件包到仓库
cp /media/Packages/* /centos-local-repo/

4.安装createrepo
yum -y createrepo

5.生成元数据
createrepo /centos-local-repo/

6.修改yum配置文件
vim /etc/yum.repos.d/CentOS-Local.repo
[Local]
name= CentOS-6 – Local
baseurl=file:///centos-local-repo/

7.查看仓库
yum repolist