提前准备:
- Yum源服务器:
可以是内网的任意服务器,要保证服务器空间足够 - Yum源镜像文件
这里可以用已下载的repo包集,也可以用iso镜像
步骤:
-
yum源服务端:
mkdir /mnt/iso
mount -o loop -t iso9660 xxx.iso /mnt/iso/
cd /etc/yum.repos.d/
mkdir bak
mv *.repo bak/
[xxx]
[private]
name=isofile
baseurl=file:///mnt/iso
enabled=1
gpgcheck=0
gpgkey=file:///mnt/iso/RPM-GPG-KEY-neokylin-release
yum clean all
yum makecache
yum repolist
yum -y install httpd
systemctl start httpd
systemctl enable httpd
systemctl stop firewalld
systemctl disable firewalld
ln -s /mnt/iso /var/www/html
-
yum源客户端:
cd /etc/yum.repos.d/
mkdir bak
mv *.repo bak/
[xxx]
[private]
name=isofile
baseurl=http://10.x.x.x/iso
enabled=1
gpgcheck=0
gpgkey=http://10.x.x.x/iso/RPM-GPG-KEY-neokylin-release
yum clean all
yum makecache