CentOS各版本挂载光盘做yum源安装

mount /dev/cdrom /media

##Centos5##

vi /etc/yum.repos.d/CentOS-Base.repo

[c5-media]

name=CentOS-$releasever - Media

baseurl=file:///media/

gpgcheck=1

enabled=1 

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#gpgcheck=1     ---->>是否启动检查GPG-KEY

#enabled=1      ---->>是否启用YUM源

##pgkey=***     ---->>指定挂载目录下的GPG-KEY文件


##CentOS_6##

vi /etc/yum.repos.d/CentOS-Media.repo

[c6-media]

name=CentOS-$releasever - Media

baseurl=file:///media/CentOS/

## 添加或者修改为以下行 ##

file:///media/

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


##CentOS_7##

[cdrom]

name=CentOS7 - cdrom

baseurl=file:///media/

enable=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7



清除缓存 建立新缓存

[root@localhost ~]# yum clean all (清除缓存)

[root@localhost ~]# yum makecache (建立新缓存)


CentOS_6 搭建本地光盘YUM源

http://www.centoscn.com/image-text/config/2014/0629/3223.html

你可能感兴趣的:(media,File,光盘)