命令:mkdir /westos
命令:mount /root/CentOS-7-x86_64-Everything-2009.iso /westos
# 切换到yum源配置文件所在目录 cd /etc/yum.repos.d/ # 创建新的目录存放历史配置文件 mkdir old # 将目录下的历史配置文件移到创建的目录下 mv CentOS-* ./old/ # 创建新的本地源配置文件 vim local.repo
local.repo配置文件内容如下
[westos] name=westos baseurl=file:///westos enable=1 gpgcheck=0
[webtos]:名称name=westos:对yum源的描述baseurl=file:///westos:指定yum源的路径gpgcheck=0:是否进行gpg检测 0-不检测 1-检测
3.4 测试挂载成功
# 清除原有yum缓存 [root@ydgq yum.repos.d]# yum clean all 已加载插件:fastestmirror, langpacks 正在清理软件源: westos Cleaning up list of fastest mirrors Other repos take up 125 M of disk space (use --verbose for details) # 查看yum源信息 [root@ydgq yum.repos.d]# yum repolist 已加载插件:fastestmirror, langpacks Determining fastest mirrors westos | 3.6 kB 00:00:00 (1/2): westos/group_gz | 153 kB 00:00:00 (2/2): westos/primary_db | 6.1 MB 00:00:00 源标识 源名称 状态 westos westos 10,072 repolist: 10,072 # 查看yum源中包含安装包信息 [root@ydgq yum.repos.d]# yum list



