使用folder制作外包镜像
制作成功的镜像
我们将该镜像挂载
使用rz命令将其拷贝到/root路径下 然后挂载到opt下
[root@StorageSrv ~]# mount /root/centos.iso /opt
mount: /dev/loop0 写保护,将以只读方式挂载
[root@StorageSrv ~]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
源标识 源名称 状态
centos centos 10,072
repolist: 10,072
该配置一定要牢记
首先将本地镜像源移到/root目录下
[root@StorageSrv ~]# mv /etc/yum.repos.d/* /root
[root@StorageSrv ~]# ls
anaconda-ks.cfg CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo CentOS-x86_64-kernel.repo
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
配置本地yum源
[root@StorageSrv ~]# vi /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///mnt
gpgcheck=0
enabled=1
将镜像挂载上
[root@StorageSrv ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@StorageSrv ~]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
centos | 3.6 kB 00:00:00
(1/2): centos/group_gz | 153 kB 00:00:00
(2/2): centos/primary_db | 6.1 MB 00:00:00
源标识 源名称 状态
centos centos 10,072
repolist: 10,072
配置centos外部包
[root@StorageSrv ~]# vi /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///mnt
gpgcheck=0
enabled=1
[centosrpm]
name=centosrpm
baseurl=file:///opt
gpgcheck=0
enabled=1