LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 735|回复: 1

配置本地光盘做yum源的问题,求教ing

[复制链接]
发表于 2010-6-15 19:59:43 | 显示全部楼层 |阅读模式
本人菜鸟,如题,做法如下,请各位看看问题如何解决
把光盘加载到本地

[root@localhost CentOS]# mount /dev/cdrom /media

在/etc/yum.repos.d/目录下,有两个文件

注释CentOS-Base.repo,修改
CentOS-Media.repo:


# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-5. 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=c5-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c5-media [command]
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-beta
-------------------------------------------------------
执行命令yum  --enablerepo=c5-media install vsftpd,提示为:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
file:///media/CentOS/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/media/CentOS/repodata/repomd.xml'
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: c5-media. Please verify its path and try again


搜索后,有教程说要配置createrepo,安装后执行
createrepo -g /media/repodata/repomd.xml /media/CentOS/命令,建立包依赖关系库,但报错Directory /media/CentOS must be writable.
可是/media/CentOS是光盘本身的目录,是只读的,不能改属性吧,但改变目录,如执行:createrepo -g /media/repodata/repomd.xml /root,就不报错,但仍然无法yum安装,不知道问题在哪里了
发表于 2010-6-16 02:59:46 | 显示全部楼层
就该不用createrepo了,你在/media下面建一个CentOS目录再挂载光盘到这个目录,应该直接就可以用了,当然要改一下下面这个:
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/

gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-beta

把 enabled=0 改成 enabled=1 再试试。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表