CentOS6 create Yum warehouse

1. Mounting of the system or system image file
Mount / dev / CDROM / Media
or
Mount -o-Loop centos6 XXX.iso / mnt

2. Create a warehouse
mkdir / centos-local-repo

3. Copy the package to the warehouse
cp / media / Packages / * / centos-local-repo /

4.安装createrepo
yum -y createrepo

The metadata is generated
createrepo / centos-local-repo /

6. Modify yum configuration
Vim /etc/yum.repos.d/CentOS-Local.repo
[the Local]
name =-the CentOS. 6 - the Local
BaseURL = File: ///-local-CentOS the repo /

7. Review the warehouse
yum repolist

Guess you like

Origin blog.51cto.com/zenglinux/2453485