通过命令 yum install system-config-kickstart-2.8.6.5-1.el6.noarch.rpm 时, 发现无法连接互联网,而采用rpm安装时又发现存在依赖关系非常复杂,只能采用从本地进行安装。
1、在centos系统里插入光盘
2、修改CentOS-Media.repo 文件
[root@node0 mnt]# vi /etc/yum.repos.d/CentOS-Media.repo
# 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]
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
file:///mnt/forYum
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
说明: “file:///mnt/forYum”这一行是添加上去的。
3、将光盘里的所有内容复制到forYum下
cp -rf /mnt/cdrom /mnt/forYum
4、进入/mnt/forYum/Packages目录下(非常关键,否则会无法安装),root用户执行:
[root@node0]# yum --disablerepo=* --enablerepo=c6-media install system-config-kickstart-2.8.6.5-1.el6.noarch.rpm
说明:如果不在此目录执行,会出现无法安装的情况。
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* c6-media:
Setting up Install Process
No package system-config-kickstart-2.8.6.5-1.el6.noarch.rpm available
参考:
http://blog.csdn.net/silent1/article/details/7637272
http://blog.chinaunix.net/uid-16974460-id-3080622.html