1. Install createrepo
yum install createrepo
2. Copy the CD image file to /usr/local/src
cp CentOS-7.0-1406-DVD.iso /usr/local/src
3. Mount the installation CD file to
mkdir /media/CentOS7- LocalSource mount -t iso9660 -o loop/usr/local/src/CentOS-7.0-1406-DVD.iso /media /
CentOS7 -
LocalSource : If fstab is wrongly written, it will enter emergency mode and the system cannot be loaded normally) /usr/local/src/CentOS-7.0-1406-DVD.iso /media/CentOS7-LocalSource iso9660 defaults,ro,loop 0 0 5. Rewrite repodata (This operation is not required for the unmodified disc image) cd /media createrepo CentOS7-LocalServer 6. Configuration source vi /etc/yum.repos.d/CentOS7-LocalServer.repo [CentOS7-LocalServer]
name=LocalServer
baseurl=ftp://192.168.1.119/CentOS7-LocalServer
enable=1
gpgcheck=0
7. Rebuild the yum cache
yum clean all
yum makecache
8. The local yum source is built, install apache to test
yum --enablerepo= CentOS7-LocalSource install httpd
centos7 build local yum source
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=326825116&siteId=291194637
Ranking