1 Build LAN Yum Source (CENTOS7) 1.1 Yum Server install HTTP service based on HTTP
1) Install HTTP
Yum Install httpd httpd-devel–y
2) Start httpd service
Systemctl Restart Httpd.service
Setenforce 0 #关闭SELinux
Systemctl Stop Firewalld #临时停止防火墙
1.2 Yum server build LAN Yum source
1) Mount disc image file
Mount/dev/cdrom/mnt
2) Copy the CD package to the HTTP directory
Mkdir/var/www/html/centos7
Cp-r/mnt/packages/*/var/www/html/centos7/
3) Create a local source using Createrepo, generate the Repodata directory in the CENTOS7 directory
Yum Install createrepo*-y
cd/var/www/html/
Createrepo centos7/
1.3 Yum Client Create Http.repo file
1) Configure the repo file
cd/etc/yum.repos.d/
VI Http.repo
2) Clear Yum cache and install software test
Yum Clean All
Yum Install Ntpdate-y
2 Yum Source Package extensions
Packages that are not in the local disc image need to be added to the Yum server (the following is an example of the NTFS-3G package)
1) Download ntfs-3g package to/var/www/html/centos7
cd/var/www/html/centos7/
wget http://rpmfind.net/linux/epel/7/x86_64/Packages/n/ntfs-3g-2017.3.23-6.el7.x86_64.rpm
wget http://rpmfind.net/linux/epel/7/x86_64/Packages/n/ntfs-3g-devel-2017.3.23-6.el7.x86_64.rpm
2) Createrepo Command update package
Cd/var/www/html
Createrepo--update centos7/
3) Client Yum authentication Install NTFS-3G Package
Yum Install Ntfs-3g-y
3 Synchronous External Network Yum source
All packages from the Yum source can be synchronized locally to improve the number and completeness of the local Yum source packages
There are three common ways to get out of the network Yum source software: rsync, wget, Reposync
Rsync: Requires an extranet yum source to support the Rsync protocol
wget: Direct Access
Reposync: Can synchronize almost all Yum sources
The following is an example of reposync, synchronizing the external yum source software to a local
1) Yum server download Centos7 repo file to/etc/yum.repos.d/and install reposync command tool
cd/etc/yum.repos.d/
wget Http://mirrors.163.com/.help/CentOS7-Base-163.repo
MV Centos7-base-163.repo Centos.repo
Yum Clean All
Yum Install yum-utils createrepo-y
Yum Repolist All
2) through the Reposync command tool to obtain all packages of the extranet Yum source,-R to specify the Repolist ID, the default does not add-r means to get the extranet all Yum packages, the-p parameter indicates the path of the specified download package
Reposync-r base-p/var/www/html/centos7/
3) After downloading the package, you need to perform Createrepo update the local yum repository
createrepo/var/www/html/centos7/
Build LAN Yum source + package extension + synchronous external network Yum source based on HTTP