Rehat Enterprise Linux 5:配置本地yum源

编辑/etc/yum.repos.d/rhel-debuginfo.repo,删掉原来的内容,添加如下内容:

[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=file:///media/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
[ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=file:///media/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=file:///media/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=file:///media/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releas

3 修改yum代码

修改/usr/lib/Python2.4/site-packages/yum/yumRepo.py
找到
remote = url + '/' + relative
这行,修改为remote = '/media/Server' + '/' + relative

4.导入GPG key

#rpm --import /etc/pki/rpm-gpg/RPM*
不导入的话,在yum install包时会有下面的提示:

Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186
Importing GPG key 0x37017186 "Red Hat, Inc. (release key) <security@redhat.com>"

这是由于yum安装了旧版本的GPG keys造成的

做完上面的设置后就可以通过本地资源进行yum安装所需的包了.

推荐阅读

RedHat Linux 本地yum源的配置

RedHat 6.2 Linux修改yum源免费使用CentOS

配置EPEL YUM源

Redhat 本地yum源配置

yum的配置文件说明

RedHat 6.1下安装yum(图文)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/18271.html