yum本地仓库搭建

[root@localhost ~]# rpm -qa httpd
httpd-2.4.6-80.el7.centos.x86_64
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# ss -lntup|grep 80
tcp LISTEN 0 128 :::80 :::* users:(("httpd",pid=1087,fd=4),("httpd",pid=1086,fd=4),("httpd",pid=1085,fd=4),("httpd",pid=1084,fd=4),("httpd",pid=1083,fd=4),("httpd",pid=1081,fd=4))
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# mkdir -p centos/7/os/x86_64/
[root@localhost html]# mount /dev/sr0 /var/www/html/centos/7/os/x86_64/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost html]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda3 18G 2.7G 16G 15% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 493M 6.8M 486M 2% /run
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/sda1 197M 97M 100M 50% /boot
tmpfs 99M 0 99M 0% /run/user/0
/dev/sr0 792M 792M 0 100% /var/www/html/centos/7/os/x86_64
yum仓库_第1张图片

yum仓库_第2张图片

创建yum client配置

[root@localhost yum.repos.d]# vim net.repo
[centos]
name=http server
baseurl=http://172.16.10.76/centos/$releaserver/os/$basearch
gpgkey=http://172.16.10.76/centos/$releaserver/os/x86_64/RPM-GPG-KEY-CentOS-$rel
easerver