当前位置: > RedHat >

RedHat Linux设置yum软件源为本地ISO

时间:2015-01-14 23:14来源:linux.it.net.cn 作者:IT

先挂载ISO到某个目录下(如我的:/media/rheliso/):

# mount –o loop rhel-server-6.4-x86_64-dvd.iso /media/rheliso/ 
# mount –o loop rhel-server-6.4-x86_64-dvd.iso /media/rheliso/


然后编辑rhel-source.repo文件

#vi /etc/yum.repos.d/rhel-source.repo 
#vi /etc/yum.repos.d/rhel-source.repo


加入以下内容(注意对应挂载目录):


[Server] 
name=rhel5server 
baseurl=file:///media/rheliso/Server 
enable=1 
gpgcheck=1 
gpgkey=file:///media/rheliso/RPM-GPG-KEY-redhat-release 

[Server]
name=rhel5server
baseurl=file:///media/rheliso/Server
enable=1
gpgcheck=1
gpgkey=file:///media/rheliso/RPM-GPG-KEY-redhat-release


注:如果使用下面命令发现如下错误


#yum install eclipse 

----------------------------------------------------------------------------------------------------------------------- 
Total                                                                                   52 MB/s | 180 MB     00:03      
Running rpm_check_debug 
Running Transaction Test 

Transaction Check Error: 
file /usr/share/java/commons-codec.jar from install of jakarta-commons-codec-0:1.3-11.7.el6.x86_64 conflicts with file from package apache-commons-codec-1.1-2.2.noarch 
 
Error Summary 



#yum install eclipse
-----------------------------------------------------------------------------------------------------------------------
Total                                                                                   52 MB/s | 180 MB     00:03    
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/java/commons-codec.jar from install of jakarta-commons-codec-0:1.3-11.7.el6.x86_64 conflicts with file from package apache-commons-codec-1.1-2.2.noarch

Error Summary
-------------



 

并且/etc/yum.repos.d/ 目录下有个文件名为'packagekit-media.repo'

请删除之就OK了!!

 

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容