1、备份/etc/yum.repos.d/文件

[root@www ~]# cp -r /etc/yum.repos.d/ /etc/yum.repos.d.bak

[root@www ~]# ls /etc/yum.repos.d* -d

/etc/yum.repos.d  /etc/yum.repos.d.bak


2.删除系统网络yum文件

[root@www ~]# rm -rf /etc/yum.repos.d/CentOS-Base.repo 

[root@www ~]# yum repolist

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

repolist: 0


3.创建本地yum源配置文件

[root@www ~]# vim /etc/yum.repos.d/cdrom.repo

[cdrom]

name=cdrom

baseurl=file:///mnt/cdrom

gpgcheck=0

enable=1


4.虚拟机连接DVD,挂载光驱

[root@www ~]# mkdir /mnt/cdrom


[root@www ~]# mount /dev/sr0 /mnt/cdrom/

mount: block device /dev/sr0 is write-protected, mounting read-only


5.列出yum仓库

[root@www ~]# yum repolist

1.2Centos6.5本地yum源配置_yum源配置

[root@www ~]# yum install samba

1.2Centos6.5本地yum源配置_yum源配置_02


6.删除yum进程

  [root@www ~]# rm -f /var/run/yum.pid