Linux systems: CentOS
This assumes use of two machines to simulate a machine to do YUM installation sources, another machine as a test machine.
1. First, we use as a source of http YUM installation source, so we need to make sure that the machine has been installed apache, if not installed, then you can use "sudo yum install httpd" to install. After installation you can use the "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 / mnt
sudo mkdir -p /var/www/html/yum_repos/CentOS6.6
sudo ln -s / mnt Packages
3. Visit the following address in your browser, you can see the list of files, then YUM server must have already set up good.
http: // < yum_host > /yum_repos/CentOS6.6/Packages
4. In order to ensure that YUM source to create their own, we first test "/etc/yum.repos.d/*.repo" machine back up
sudo mkdir -p /etc/yum.repos.d/bak
sudo mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
Then create your own repo file, such as "my.repo", document reads as follows:
name = my-repo
baseurl = http: // /yum_repos/CentOS6.6/Packages
enabled = 1
gpgcheck = 0
priority = 1
Where point we've built YUM source machine name or IP.
Running on a test machine "sudo yum list" you can see our building RPM package list YUM source, but we can also use "sudo yum install < PACKAGE >" to install the packages.