詳解:RHEL5下實現本地YUM源的過程(zt)

tonykorn97發表於2008-04-02

系統平臺:Red Hat Enterprise Linux Server release 5 (Tikanga)
 
 方法一步驟:



 
  1、 將DVD光碟掛載到/media/cdrom中;
 
  2、 複製/media/cdrom中的所有檔案到/media/yum1;
 
  3、 /etc/yum.repos.d/rhel-debuginfo.repo :
 
  [Cluster]
 
  name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
 
  baseurl=file:///media/yum1/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/yum1/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/yum1/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/yum1/VT
 
  enabled=1
 
  gpgcheck=1
 
  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
 
  4、/usr/lib/python2.4/site-packages/yum/yumRepo.py第411行:
 
  remote = url + '/' + relative
 
  改為:
 
  remote = “/media/yum1/Server” + '/' + relative
 
  5、yum clean all
 
  6、yum install iptraf 測試!成功!!!
 
  方法二步驟:
 
  1、將DVD光碟掛載到/media/cdrom中;
 
  2、複製/media/cdrom/Server中的所有檔案到/media/yum2;
 
  3、/etc/yum.repos.d/rhel-debuginfo.repo :
 
  [Server]
 
  name=Red Hat Enterprise Linux $releasever - $basearch - Server
 
  baseurl=file:///media/yum2
 
  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/yum2
 
  enabled=1
 
  gpgcheck=0
 
  這樣修改也是可以的。
 
  [Server]
 
  name=Red Hat Enterprise Linux $releasever - $basearch - Server
 
  baseurl=file:///media/yum2
 
  gpgcheck=1
 
  這樣修改也是可以的。
 
  4、/usr/lib/python2.4/site-packages/yum/yumRepo.py第411行:
 
  remote = url + '/' + relative
 
  改為:
 
  remote = “/media/yum2” + '/' + relative
 
  5、yum clean all
 
  6、yum install iptraf 測試!成功!!!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-245847/,如需轉載,請註明出處,否則將追究法律責任。

相關文章