一、ISO文件制作
[[email protected] ~]# mkdir /media/cdrom 建立目录
[[email protected] ~]# mount /dev/cdrom /media/cdrom/ 挂载光盘

[[email protected] ~]# mkdir /mnt/yum
[[email protected] ~]# mkdir /mnt/yum
[[email protected] ~]# cp -a /media/cdrom/ /mnt/yum/
[[email protected] ~]#cd /etc/yum.repo/
[[email protected] ~]#vim media.repo
[Media-ISO]
name=CentOS-$releasever - Media
baseurl=file:///yum/cdrom/ # 配置 repo 路径
gpgcheck=0 # 关闭 gpg 校验
enabled=1 # 启用此 repo
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

make clean all 清理本地缓存
make makecache 构建本地缓存

二、自建本地YUM源


mkdir -p /mnt/localPackages
cp /mnt/yum/ftp-1.5.0.0.x86.rpm /mnt/localPackages
.....
.....
.....

cd /mnt/localPackages
createrepo -u -d /mnt/localPackages

vim /etc/yum.repos.d/localpackages.repo
[localpackages]
name=redhat7
baseurl=file:///mnt/localPackages
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Redhat-7

标签: Linux, root, yum, mnt, file, cdrom, YUM, 几种

相关文章推荐

添加新评论,含*的栏目为必填