linux local source configuration yum
When often install some software, too many things depend on, or the network itself, making it easy software installation fails, this time we can configure yum local source, you will need software to synchronize the rpm package locally, and then use a local source. For example, when installing ambari, we usually put ambari synchronized to the local installation source and install it.
1 install httpd
Httpd is one open source project by the ASF (apache software foundation) maintenance is one of the most popular web server currently has three maintenance releases are rich 2.1 2.2 2.4 features: rich highly modular design excellent stability of OSD support third-party plug-ins.
yum -y install httpd.x86_64
2. synchronous network source
Network using tools synchronized to the local source, here is an example of a source synchronous ambari
2.1 install wget
yum -y install wget.x86_64
Source 2.2 download ambari2.6.0 to /etc/yum.repos.d/ directory
wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
2.3 List View Source
yum repolist
2.4 Installation yum-utils
yum -y install yum-utils
2.5 Synchronization Source
reposync -r ambari-2.6.0.0
2.6 the source files / var / www / html / directory
After performing the synchronization command, will be a directory, the directory to / var / www / html / lower
mv /etc/yum.repos.d/ambari-2.6.0.0 /var/www/html/
3 Use createrepo create a local source
3.1 Installation createrepo
yum -y install createrepo
Switch to /var/www/html/ambari-2.6.0.0 directory 3.2
cd /var/www/html/ambari-2.6.0.0/
3.3 Creating a local source
createrepo .
4 Other sources installation
Install a local source principle is the same, that is the source of the network installation package rpm synchronous or downloaded to a local directory, and then install httpd service, will be stored under the directory has been downloaded rpm package moved to / var / www / html Under contents. Then create a local source. We can use this source of.
5 service httpd restart
systemctl restart httpd.service