mkdir -p /mnt/cdrom #创建挂载目录
mount /dev/cdrom /mnt/cdrom #挂载光盘
2、修改yum源配置文件:
1
2
3
4
ls -l /etc/yum.repos.d/ #进入yum源配置文件目录
mv CentOS-Base.repo CentOS-Base.repose_bak #重命名或删除CentOS-Base.repo文件
mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo_bak #重命名或删除CentOS-Debuginfo.repo文件
vi CentOS-Media.repo #编辑文件CentOS-Media.repo,内容大致如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c6-media [command]