1、首先将你的光驱重新挂载到其他的目录中去如:mount /dev/sr0(光驱的路径) /cdrom(光驱的挂载点)
2、修改cd /etc/yum.repos.d/
建立一个文件夹如:bak
然后将/etc/yum.repos.d中的文件全都移到bak当中去
进入bak文件复制fedora.repo文件到 /etc/yum.repos.d中去
修改fedora.repo文件如下
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
将[fedora-debuginfo]
name=Fedora $releasever - $basearch 。。。。到最后全删了
然后将failovermethod=priority和mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
这一行删了
再将#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
这一行该成baseurl=file:///cdrom就行了
然后用#yum list 测试
第一步:创建一个新文件夹,并把光盘的内容全部复制到该文件夹内:[root@localhost ~]# mkdir /yum
[root@localhost ~]# cp -rvf /misc/cd/* /yum
第二步:安装工具包:
[root@localhost ~]# rpm -ivh /yum/Server/createrepo-0.4.11-3.el5.noarch.rpm
第三步:生成仓库数据库:
[root@localhost ~]# cd /yum
[root@localhost yum]# createrepo . //注意后面的.
第四步:查看文件:
[root@localhost yum]# ls /yum/repodata/
filelists.xml.gz other.xml.gz primary.xml.gz repomd.xml
第五步:客户端配置:
[root@localhost ~]# cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/chenbin.repo
[root@localhost ~]# vi /etc/yum.repos.d/chenbin.repo [rhel-chenbin]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
第六步:清除yum安装时的缓存:
[root@localhost ~]# yum clean all
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)