Linux配置本地yum源
#1,创建挂载目录
[root@localhost ~]# mkdir /mnt/cdrom
#2,用mount命令挂载
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom
#3,配置yum源文件
[root@localhost ~]# vim /etc/yum.repos.d/centos.repo
[centos]
name=centos
baseurl=file:///mnt/cdrom
gpgcheck=0
enabled=1
#4,清除缓存
[root@localhost ~]# yum clean all
#5,安装测试
[root@localhost ~]# yum -y install gcc #左下角有Complete表示成功。