How to Create Yum Server and Client
[root@Apache ~]# mount /dev/sr0 /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@Apache ~]# ls /mnt/
CentOS_BuildTag EFI EULA GPL images isolinux LiveOS Packages repodata RPM-GPG-KEY-CentOS-7 RPM-GPG-KEY-CentOS-Testing-7 TRANS.TBL
[root@Apache ~]# vim /etc/yum.repos.d/yum.repo
[server]
name=server
baseurl=file:///mnt
gpgcheck=0
enable=1
[root@Apache ~]# yum clean all
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Cleaning repos: server
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@Apache ~]# yum repolist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
server | 3.6 kB 00:00:00 (1/2):
server/group_gz | 156 kB 00:00:00 (2/2):
server/primary_db | 3.1 MB 00:00:00
Determining fastest mirrors
repo id repo name status
server server 3,894
repolist: 3,894
[root@Apache ~]# yum install httpd -y
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-67.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-67.el7.centos for package: httpd-2.4.6-67.el7.centos.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-67.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================
Installing:
httpd x86_64 2.4.6-67.el7.centos server 2.7 M
Installing for dependencies:
httpd-tools x86_64 2.4.6-67.el7.centos server 87 k
Transaction Summary
=========================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 2.8 M
Installed size: 9.5 M
Downloading packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 26 MB/s | 2.8 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : httpd-tools-2.4.6-67.el7.centos.x86_64 1/2
Installing : httpd-2.4.6-67.el7.centos.x86_64 2/2
Verifying : httpd-2.4.6-67.el7.centos.x86_64 1/2
Verifying : httpd-tools-2.4.6-67.el7.centos.x86_64 2/2
Installed:
httpd.x86_64 0:2.4.6-67.el7.centos
Dependency Installed:
httpd-tools.x86_64 0:2.4.6-67.el7.centos
Complete!
[root@Apache ~]# systemctl restart httpd
[root@Apache ~]# cp -rv /mnt/* /var/www/html/yum/
[root@Apache ~]# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf_1
[root@Apache ~]# systemctl restart httpd
[root@Apache ~]# vim /etc/yum.repos.d/yum.repo
[server]
name=server
baseurl=http://Server_IP/yum
gpgcheck=0
enable=1
[root@Apache ~]# yum clean all
[root@Apache ~]# yum repolist
[root@Apache ~]# yum install PKG_Name
Comments
Post a Comment