|
本人菜鸟,如题,做法如下,请各位看看问题如何解决
把光盘加载到本地
[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安装,不知道问题在哪里了 |
|