1. Build Apache server or FTP server
Yum Install–y httpd
Serivce httpd Start (host's address is 192.168.176.128)
Yum installation or binary package installation
2, prepare the RPM package to the CentOS DVD1 and Dvd2.iso are downloaded, the Dvd1.iso all the content extracted, put into the/var/www/html/centos-6 directory, Then the dvd2.iso extracted from the packages directory of the RPM package copied to the/var/html/centos-6/packages directory, so/var/html/centos-6/packages there are more than 6,000 RPM package.
Mkdir/var/www/htm/centos-6
mount/dev/sr0/mnt/
cp/mnt/packages/*/var/www/html/centso-6/#将光盘内包含的rpm包复制到/var/www/html/centso-6/
To access the Web:
Http://192.168.176.128/centos-6
The following interface will appear:
3. Create a Yum repository
Prepare createrepo:yum-y Install Createrepo
Create repository:createrepo/var/www/html/centos-6/
After the creation is complete, some files are generated under/var/www/html/centos-6/repodata.
4. Using the software source
Try a software source on another CentOS machine.
First modify the software source configuration file on the machine:
# cd/etc/yum.repos.d/
# mkdir BK
# MV *.repo bk/
# CP Bk/centos-base.repo./
# VI Centos-base.repo
The Centos-base.repo file is modified as follows:
[Base]
name=centos-$releasever-base
baseurl=http://*.*.*.*/centos-6/#其中星号的地方改为192.168.176.128, hereinafter
Gpgcheck=1 (change to 0 below the line is not set up)
Gpgkey=http:///*.*.*.*/centos-6/rpm-gpg-key-centos-6
Enabled=1
#released Updates
#[updates]
#name =centos-$releasever-updates
#baseurl =http:///*.*.*.*/centos-6/
#gpgcheck =1
#gpgkey =http:///*.*.*.*/centos-6/rpm-gpg-key-centos-6
#enabled = 1
Once saved, you can use the local area network's software Source:
# Yum Update
Original address: http://www.linuxidc.com/Linux/2013-07/87315.htm
Yum LAN software source setup