方法一步驟:
一、 將DVD光盤掛載到/media/cdrom中;
二、 拷貝/media/cdrom中的全部文件到/media/yum1;
三、 /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
四、/usr/lib/python2.4/site-packages/yum/yumRepo.py第411行:
remote = url + '/' + relative
改成:
remote = 「/media/yum1/Server」 + '/' + relative
五、yum clean all
六、yum install iptraf 測試!成功!!!
方法二步驟:
一、將DVD光盤掛載到/media/cdrom中;
二、拷貝/media/cdrom/Server中的全部文件到/media/yum2;
三、/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
這樣修改也是能夠的。
四、/usr/lib/python2.4/site-packages/yum/yumRepo.py第411行:
remote = url + '/' + relative
改成:
remote = 「/media/yum2」 + '/' + relative
五、yum clean all
六、yum install iptraf 測試!成功!!!
通過測試最簡單的方法:
[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=file:///mnt/Server
enabled=1
若是還要更改KEY驗證的話,能夠在vim /etc/yum.conf python