#将安装包上传到/mnt下
#创建文件挂载目录
mkdir /os/centos1
mkdir /os/centos2
#挂载文件镜像,配置yum源
mount -t iso9660 -o loop CentOS-6.8-x86_64-bin-DVD1.iso /media
cd /etc/yum.repos.d/
#修改配置文件
rm -rf *
cat <<EOF>local.repo
[Centos]
name=centos
baseurl=file:///media
#baseurl=ftp://172.24.20.140/pub
gpgcheck=0
enable=1
EOF
chmod 755 local.repo
安装createrepo软件包
yum install -y creatrepo phthon-deltarpm deltarpm vsftpd
#挂载镜像到/os/cetos目录下,并将软件包复制到ftp目录下
mount -t iso9660 -o loop /mnt/CentOS-6.8-x86_64-bin-DVD1.iso /os/centos1
mount -t iso9660 -o loop /mnt/CentOS-6.8-x86_64-bin-DVD2.iso /os/centos2
cp -rf /os/centos1/packeges/* /var/ftp/pub/
cp -rf /os/centos2/packeges/* /var/ftp/pub/
#在/pub目录中创建yum仓库
cd /var/ftp/pub/
createrepo -v .
原文地址:https://www.cnblogs.com/xiaomabrother/p/10209793.html
时间: 2024-10-09 17:54:55