Linux挂载iso镜像、配置本地yum源
[root@localhost ~]# ll /etc/yum.repos.d/ [root@localhost ~]# mkdir /etc/yum.repos.d.bak [root@localhost ~]# mv /etc/yum.repos.d/* /etc/yum.repos.d.bak/ [root@localhost ~]# ll /etc/yum.repos.d/ [root@localhost ~]# ll /etc/yum.repos.d.bak/
[root@localhost ~]# mkdir /mnt/CentOS7 # 创建挂载目录 [root@localhost ~]# mount /Tools/CentOS-7-x86_64-DVD-2009.iso /mnt/CentOS7 # 挂载 [root@localhost ~]# ll /mnt/CentOS7/
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-local.repo
[base-local] name=CentOS-local baseurl=file:///mnt/CentOS7 enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@localhost ~]# yum clean all [root@localhost ~]# yum makecache
[root@localhost ~]# yum -y install gcc