歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Rehat Enterprise Linux 5:配置本地yum源

Rehat Enterprise Linux 5:配置本地yum源

日期:2017/2/28 14:33:51   编辑:Linux教程

Rehat Enterprise Linux 5:配置本地yum源,測試正常。

配置本地yum源

本地源首選使用DVD安裝盤

1.掛載鏡像

mount -t iso9660 /dev/cdrom /media/
命令將鏡像掛載到/media/文件夾下。

2 編輯倉庫設置

編輯/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) <[email protected]>"

這是由於yum安裝了舊版本的GPG keys造成的

做完上面的設置後就可以通過本地資源進行yum安裝所需的包了.

推薦閱讀

RedHat Linux 本地yum源的配置 http://www.linuxidc.com/Linux/2013-08/88217.htm

RedHat 6.2 Linux修改yum源免費使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm

配置EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htm

Redhat 本地yum源配置 http://www.linuxidc.com/Linux/2012-11/75127.htm

yum的配置文件說明 http://www.linuxidc.com/Linux/2013-04/83298.htm

RedHat 6.1下安裝yum(圖文) http://www.linuxidc.com/Linux/2013-06/86535.htm

YUM 安裝及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm

更多RedHat相關信息見RedHat 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=10

Copyright © Linux教程網 All Rights Reserved