Configure Firewall
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
Install Httpd & Start Service
[root@localhost ~]# yum install httpd -y
[root@localhost ~]# systemctl enable httpd.service
[root@localhost ~]# systemctl restart httpd.service
[root@localhost ~]# systemctl status httpd.service
Now, Take the Browser
http://192.168.220.200
Install Reposync
[root@localhost ~]# yum install yum-utils -y
Create Repo Dir
[root@localhost ~]# mkdir /var/www/html/myrepo
[root@localhost ~]# cd /var/www/html/myrepo
List Repo
[root@localhost myrepo]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,591
extras/7/x86_64 CentOS-7 - Extras 284
updates/7/x86_64 CentOS-7 - Updates 1,490
repolist: 11,365
Sync Repo
[root@localhost myrepo]# reposync --repoid=base
[root@localhost myrepo]# reposync --repoid=updates
[root@localhost myrepo]# reposync --repoid=extras
[root@localhost myrepo]# pwd
/var/www/html/myrepo
[root@localhost myrepo]# ls -al
total 0
drwxr-xr-x. 5 root root 47 Dec 6 20:18 .
drwxr-xr-x. 3 root root 20 Dec 6 03:12 ..
drwxr-xr-x. 3 root root 22 Dec 6 03:48 base
drwxr-xr-x. 3 root root 22 Dec 6 20:18 extras
drwxr-xr-x. 3 root root 22 Dec 6 20:06 updates
Install Createrepo
[root@localhost ~]# yum install createrepo -y
Create Repo
[root@localhost ~]# createrepo /var/www/html/myrepo/base
Spawning worker 0 with 9591 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@localhost ~]# createrepo /var/www/html/myrepo/updates
Spawning worker 0 with 1490 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@localhost ~]# createrepo /var/www/html/myrepo/extras
Spawning worker 0 with 284 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
Now, Take the Browser
http://192.168.220.200/myrepo/
Update Client Repo
[root@localhost ~]# diff /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
15c15
< baseurl=http://192.168.220.200/myrepo/base
---
> mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
17c17
< gpgcheck=0
---
> gpgcheck=1
23c23
< baseurl=http://192.168.220.200/myrepo/updates
---
> mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
25c25
< gpgcheck=0
---
> gpgcheck=1
31c31
< baseurl=http://192.168.220.200/myrepo/extras
---
> mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
33c33
< gpgcheck=0
---
> gpgcheck=1
Make Client Cache
[root@localhost ~]# yum clean all && yum makecache
Client Example
[root@localhost ~]# yum install vim
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.x86_64 2:7.4.160-2.el7 will be installed
--> Processing Dependency: vim-common = 2:7.4.160-2.el7 for package: 2:vim-enhanced-7.4.160-2.el7.x86_64
--> Processing Dependency: perl(:MODULE_COMPAT_5.16.3) for package: 2:vim-enhanced-7.4.160-2.el7.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 2:vim-enhanced-7.4.160-2.el7.x86_64
--> Processing Dependency: libgpm.so.2()(64bit) for package: 2:vim-enhanced-7.4.160-2.el7.x86_64
--> Running transaction check
---> Package gpm-libs.x86_64 0:1.20.7-5.el7 will be installed
---> Package perl.x86_64 4:5.16.3-292.el7 will be installed
--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Temp) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Path) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Exporter) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-292.el7.x86_64
---> Package perl-libs.x86_64 4:5.16.3-292.el7 will be installed
---> Package vim-common.x86_64 2:7.4.160-2.el7 will be installed
--> Processing Dependency: vim-filesystem for package: 2:vim-common-7.4.160-2.el7.x86_64
--> Running transaction check
---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed
---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed
---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed
---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed
---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed
---> Package perl-Getopt-Long.noarch 0:2.40-2.el7 will be installed
--> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-2.el7.noarch
--> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-2.el7.noarch
---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed
---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
--> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed
---> Package perl-Socket.x86_64 0:2.010-4.el7 will be installed
---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed
---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed
---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed
---> Package perl-constant.noarch 0:1.27-2.el7 will be installed
---> Package perl-macros.x86_64 4:5.16.3-292.el7 will be installed
---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed
---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed
---> Package vim-filesystem.x86_64 2:7.4.160-2.el7 will be installed
--> Running transaction check
---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed
---> Package perl-Pod-Escapes.noarch 1:1.04-292.el7 will be installed
---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed
--> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch
--> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch
---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed
--> Running transaction check
---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed
--> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
--> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed
--> Running transaction check
---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================
Installing:
vim-enhanced x86_64 2:7.4.160-2.el7 base 1.0 M
Installing for dependencies:
gpm-libs x86_64 1.20.7-5.el7 base 32 k
perl x86_64 4:5.16.3-292.el7 base 8.0 M
perl-Carp noarch 1.26-244.el7 base 19 k
perl-Encode x86_64 2.51-7.el7 base 1.5 M
perl-Exporter noarch 5.68-3.el7 base 28 k
perl-File-Path noarch 2.09-2.el7 base 26 k
perl-File-Temp noarch 0.23.01-3.el7 base 56 k
perl-Filter x86_64 1.49-3.el7 base 76 k
perl-Getopt-Long noarch 2.40-2.el7 base 56 k
perl-HTTP-Tiny noarch 0.033-3.el7 base 38 k
perl-PathTools x86_64 3.40-5.el7 base 82 k
perl-Pod-Escapes noarch 1:1.04-292.el7 base 51 k
perl-Pod-Perldoc noarch 3.20-4.el7 base 87 k
perl-Pod-Simple noarch 1:3.28-4.el7 base 216 k
perl-Pod-Usage noarch 1.63-3.el7 base 27 k
perl-Scalar-List-Utils x86_64 1.27-248.el7 base 36 k
perl-Socket x86_64 2.010-4.el7 base 49 k
perl-Storable x86_64 2.45-3.el7 base 77 k
perl-Text-ParseWords noarch 3.29-4.el7 base 14 k
perl-Time-HiRes x86_64 4:1.9725-3.el7 base 45 k
perl-Time-Local noarch 1.2300-2.el7 base 24 k
perl-constant noarch 1.27-2.el7 base 19 k
perl-libs x86_64 4:5.16.3-292.el7 base 688 k
perl-macros x86_64 4:5.16.3-292.el7 base 43 k
perl-parent noarch 1:0.225-244.el7 base 12 k
perl-podlators noarch 2.5.1-3.el7 base 112 k
perl-threads x86_64 1.87-4.el7 base 49 k
perl-threads-shared x86_64 1.43-6.el7 base 39 k
vim-common x86_64 2:7.4.160-2.el7 base 5.9 M
vim-filesystem x86_64 2:7.4.160-2.el7 base 9.8 k
Transaction Summary
=========================================================================================================================
Install 1 Package (+30 Dependent packages)
Total download size: 18 M
Installed size: 60 M
Is this ok [y/d/N]: y
Downloading packages:
(1/31): gpm-libs-1.20.7-5.el7.x86_64.rpm | 32 kB 00:00:00
(2/31): perl-Carp-1.26-244.el7.noarch.rpm | 19 kB 00:00:00
(3/31): perl-5.16.3-292.el7.x86_64.rpm | 8.0 MB 00:00:00
(4/31): perl-Encode-2.51-7.el7.x86_64.rpm | 1.5 MB 00:00:00
(5/31): perl-Exporter-5.68-3.el7.noarch.rpm | 28 kB 00:00:00
(6/31): perl-File-Path-2.09-2.el7.noarch.rpm | 26 kB 00:00:00
(7/31): perl-Filter-1.49-3.el7.x86_64.rpm | 76 kB 00:00:00
(8/31): perl-Getopt-Long-2.40-2.el7.noarch.rpm | 56 kB 00:00:00
(9/31): perl-File-Temp-0.23.01-3.el7.noarch.rpm | 56 kB 00:00:00
(10/31): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm | 38 kB 00:00:00
(11/31): perl-Pod-Escapes-1.04-292.el7.noarch.rpm | 51 kB 00:00:00
(12/31): perl-PathTools-3.40-5.el7.x86_64.rpm | 82 kB 00:00:00
(13/31): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm | 87 kB 00:00:00
(14/31): perl-Pod-Usage-1.63-3.el7.noarch.rpm | 27 kB 00:00:00
(15/31): perl-Pod-Simple-3.28-4.el7.noarch.rpm | 216 kB 00:00:00
(16/31): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm | 36 kB 00:00:00
(17/31): perl-Socket-2.010-4.el7.x86_64.rpm | 49 kB 00:00:00
(18/31): perl-Storable-2.45-3.el7.x86_64.rpm | 77 kB 00:00:00
(19/31): perl-Text-ParseWords-3.29-4.el7.noarch.rpm | 14 kB 00:00:00
(20/31): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm | 45 kB 00:00:00
(21/31): perl-Time-Local-1.2300-2.el7.noarch.rpm | 24 kB 00:00:00
(22/31): perl-constant-1.27-2.el7.noarch.rpm | 19 kB 00:00:00
(23/31): perl-macros-5.16.3-292.el7.x86_64.rpm | 43 kB 00:00:00
(24/31): perl-libs-5.16.3-292.el7.x86_64.rpm | 688 kB 00:00:00
(25/31): perl-parent-0.225-244.el7.noarch.rpm | 12 kB 00:00:00
(26/31): perl-threads-1.87-4.el7.x86_64.rpm | 49 kB 00:00:00
(27/31): perl-threads-shared-1.43-6.el7.x86_64.rpm | 39 kB 00:00:00
(28/31): perl-podlators-2.5.1-3.el7.noarch.rpm | 112 kB 00:00:00
(29/31): vim-common-7.4.160-2.el7.x86_64.rpm | 5.9 MB 00:00:00
(30/31): vim-filesystem-7.4.160-2.el7.x86_64.rpm | 9.8 kB 00:00:00
(31/31): vim-enhanced-7.4.160-2.el7.x86_64.rpm | 1.0 MB 00:00:00
-------------------------------------------------------------------------------------------------------------------------
Total 41 MB/s | 18 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:perl-parent-0.225-244.el7.noarch 1/31
Installing : perl-HTTP-Tiny-0.033-3.el7.noarch 2/31
Installing : perl-podlators-2.5.1-3.el7.noarch 3/31
Installing : perl-Pod-Perldoc-3.20-4.el7.noarch 4/31
Installing : 1:perl-Pod-Escapes-1.04-292.el7.noarch 5/31
Installing : perl-Text-ParseWords-3.29-4.el7.noarch 6/31
Installing : perl-Encode-2.51-7.el7.x86_64 7/31
Installing : perl-Pod-Usage-1.63-3.el7.noarch 8/31
Installing : 4:perl-macros-5.16.3-292.el7.x86_64 9/31
Installing : 4:perl-libs-5.16.3-292.el7.x86_64 10/31
Installing : perl-Storable-2.45-3.el7.x86_64 11/31
Installing : perl-Exporter-5.68-3.el7.noarch 12/31
Installing : perl-constant-1.27-2.el7.noarch 13/31
Installing : perl-Time-Local-1.2300-2.el7.noarch 14/31
Installing : perl-Socket-2.010-4.el7.x86_64 15/31
Installing : perl-Carp-1.26-244.el7.noarch 16/31
Installing : perl-PathTools-3.40-5.el7.x86_64 17/31
Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64 18/31
Installing : perl-File-Temp-0.23.01-3.el7.noarch 19/31
Installing : perl-File-Path-2.09-2.el7.noarch 20/31
Installing : perl-threads-shared-1.43-6.el7.x86_64 21/31
Installing : perl-threads-1.87-4.el7.x86_64 22/31
Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 23/31
Installing : perl-Filter-1.49-3.el7.x86_64 24/31
Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch 25/31
Installing : perl-Getopt-Long-2.40-2.el7.noarch 26/31
Installing : 4:perl-5.16.3-292.el7.x86_64 27/31
Installing : gpm-libs-1.20.7-5.el7.x86_64 28/31
Installing : 2:vim-filesystem-7.4.160-2.el7.x86_64 29/31
Installing : 2:vim-common-7.4.160-2.el7.x86_64 30/31
Installing : 2:vim-enhanced-7.4.160-2.el7.x86_64 31/31
Verifying : perl-HTTP-Tiny-0.033-3.el7.noarch 1/31
Verifying : perl-threads-shared-1.43-6.el7.x86_64 2/31
Verifying : perl-Storable-2.45-3.el7.x86_64 3/31
Verifying : 2:vim-filesystem-7.4.160-2.el7.x86_64 4/31
Verifying : perl-Exporter-5.68-3.el7.noarch 5/31
Verifying : perl-constant-1.27-2.el7.noarch 6/31
Verifying : perl-PathTools-3.40-5.el7.x86_64 7/31
Verifying : 4:perl-macros-5.16.3-292.el7.x86_64 8/31
Verifying : 1:perl-parent-0.225-244.el7.noarch 9/31
Verifying : 4:perl-5.16.3-292.el7.x86_64 10/31
Verifying : perl-File-Temp-0.23.01-3.el7.noarch 11/31
Verifying : 1:perl-Pod-Simple-3.28-4.el7.noarch 12/31
Verifying : perl-Time-Local-1.2300-2.el7.noarch 13/31
Verifying : gpm-libs-1.20.7-5.el7.x86_64 14/31
Verifying : 4:perl-libs-5.16.3-292.el7.x86_64 15/31
Verifying : perl-Pod-Perldoc-3.20-4.el7.noarch 16/31
Verifying : perl-Socket-2.010-4.el7.x86_64 17/31
Verifying : perl-Carp-1.26-244.el7.noarch 18/31
Verifying : 2:vim-common-7.4.160-2.el7.x86_64 19/31
Verifying : perl-Scalar-List-Utils-1.27-248.el7.x86_64 20/31
Verifying : 1:perl-Pod-Escapes-1.04-292.el7.noarch 21/31
Verifying : perl-Pod-Usage-1.63-3.el7.noarch 22/31
Verifying : perl-Encode-2.51-7.el7.x86_64 23/31
Verifying : perl-podlators-2.5.1-3.el7.noarch 24/31
Verifying : perl-Getopt-Long-2.40-2.el7.noarch 25/31
Verifying : 2:vim-enhanced-7.4.160-2.el7.x86_64 26/31
Verifying : perl-File-Path-2.09-2.el7.noarch 27/31
Verifying : perl-threads-1.87-4.el7.x86_64 28/31
Verifying : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 29/31
Verifying : perl-Filter-1.49-3.el7.x86_64 30/31
Verifying : perl-Text-ParseWords-3.29-4.el7.noarch 31/31
Installed:
vim-enhanced.x86_64 2:7.4.160-2.el7
Dependency Installed:
gpm-libs.x86_64 0:1.20.7-5.el7 perl.x86_64 4:5.16.3-292.el7
perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7
perl-Exporter.noarch 0:5.68-3.el7 perl-File-Path.noarch 0:2.09-2.el7
perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7
perl-Getopt-Long.noarch 0:2.40-2.el7 perl-HTTP-Tiny.noarch 0:0.033-3.el7
perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-292.el7
perl-Pod-Perldoc.noarch 0:3.20-4.el7 perl-Pod-Simple.noarch 1:3.28-4.el7
perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7
perl-Socket.x86_64 0:2.010-4.el7 perl-Storable.x86_64 0:2.45-3.el7
perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7
perl-Time-Local.noarch 0:1.2300-2.el7 perl-constant.noarch 0:1.27-2.el7
perl-libs.x86_64 4:5.16.3-292.el7 perl-macros.x86_64 4:5.16.3-292.el7
perl-parent.noarch 1:0.225-244.el7 perl-podlators.noarch 0:2.5.1-3.el7
perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7
vim-common.x86_64 2:7.4.160-2.el7 vim-filesystem.x86_64 2:7.4.160-2.el7
Complete!