09-企业私有仓库搭建

光盘自动挂载

yum install autofs -y
systemctl start autofs  && systemctl enable autofs
cd /misc/cd

 安装httpd,稳定,镜像源本地拷贝

Name         : httpd
Version      : 2.4.37
[root@rocky8 ~]# rpm -qc httpd
[root@rocky8 ~]# rpm -ql httpd |grep service
/usr/lib/systemd/system/htcacheclean.service
/usr/lib/systemd/system/httpd.service
[root@rocky8 html]# mkdir -p rockylinux/8/AppStream
[root@rocky8 html]# mkdir -p rockylinux/8/extras
[root@rocky8 html]# mkdir -p rockylinux/8/BaseOS
[root@rocky8 BaseOS]# cp -r /mnt/cdrom/BaseOS/* .
[root@localhost yum.repos.d]# cat BaseOS.repo 
[BaseOS]
name=BaseOs repo
baseurl=http://192.168.80.171/rockylinux/8/BaseOS
gpgcheck=0
[root@localhost yum.repos.d]# cat AppStream.repo 
[AppStream]
name=AppStream repo
baseurl=http://192.168.80.171/rockylinux/8/AppStream
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
#gpgcheck=0

 下载阿里云的extras源和epel源,制作私有yum源

[extras]
name=extras
#baseurl=https://mirrors.aliyun.com/rockylinux/$releasever/extras/$basearch/os
baseurl=https://mirrors.aliyun.com/rockylinux/8/extras/x86_64/os
gpgcheck=0
enabled=1
[root@rocky8 yum.repos.d]# yum repolist
repo id                                                                                          repo name
AppStream                                                                                        AppStream
BaseOS                                                                                           BaseOS
extras                                                                                           extras
[root@rocky8 8]# yum reposync --repoid=extras --download-metadata -p /var/www/html/rockylinux/8

 

[epel]
name=EPEL
#baseurl=https://mirrors.aliyun.com/epel/$releasever/Everything/$basearch
baseurl=https://mirrors.aliyun.com/epel/8/Everything/x86_64/
gpgcheck=0
enabled=1
[root@rocky8 yum.repos.d]# yum repolist
repo id                                                                                          repo name
AppStream                                                                                        AppStream
BaseOS                                                                                           BaseOS
PowerTools                                                                                       CentOS-8 - PowerTools
epel                                                                                             EPEL
extras                                                                                           extras
[root@rocky8 yum.repos.d]# yum reposync --repoid=epel --download-metadata -p /var/www/html/rockylinux/8

 

epel 8505个包,很大

 

[root@localhost yum.repos.d]# cat extras.repo 
[extras]
name=extras repo
baseurl=http://192.168.80.171/rockylinux/8/extras
gpgcheck=0
[root@localhost yum.repos.d]# cat epel.repo 
[epel]
name=epel repo
baseurl=http://192.168.80.171/rockylinux/8/epel
gpgcheck=0
[root@localhost yum.repos.d]# yum list epel-release
Available Packages
epel-release.noarch                                          8-13.el8                                            extras

同理 centos7 源搭建

scp -r Packages repodata 192.168.80.171:/var/www/html/centos/7/Base

 

posted @ 2022-04-08 20:44  gg888666  阅读(43)  评论(0编辑  收藏  举报