Use CentOS DVD production company YUM installation source, centosyum
Link: http://blog.csdn.net/kongxx/article/details/43821421
Assume that two machines are used for simulation. One machine is used as the YUM installation source, and the other machine is used as the testing machine.
1. First, we use the http source as the YUM installation source. Therefore, we need to first ensure that apache has been installed on the machine. If not, we can use "sudo yum install httpd" for installation. After installation, you can use "sudo service httpd start" to start the service.
2. Create a YUM installation Source
sudo mount -t auto -o loop CentOS-6.6-x86_64-bin-DVD1.iso /mntsudo mkdir -p /var/www/html/yum_repos/CentOS6.6sudo ln -s /mnt Packages
3. Access the following address in a browser. If you can see the file list, it indicates that the YUM server has been set up.
Http: // <yum_host>/yum_repos/CentOS6.6/Packages
4. To ensure that the YUM source created by ourselves is used, we first back up "/etc/yum. repos. d/*. repo" on the test machine.
sudo mkdir -p /etc/yum.repos.d/baksudo mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
Create your own repo file, for example, "my. repo". The file content is as follows:
[my-repo]name=my-repobaseurl=http://<yum_host>/yum_repos/CentOS6.6/Packagesenabled=1gpgcheck=0priority=1
<Yum_host> points to the name or IP address of the YUM source machine we set up earlier.
5. Test
Run "sudo yum list" on the test machine to view the rpm package list on the YUM source we set up. You can also use "sudo yum install <PACKAGE>" to install the software PACKAGE.