V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
grape
V2EX  ›  Linux

centos 配置 yum 需要修改/usr/lib/python2.6/site-packages/yum/yumRepo.py 文件吗?

  •  
  •   grape · 2017-12-26 19:01:25 +08:00 · 3082 次点击
    这是一个创建于 2305 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我在内网搭建了两个 yum 源,分别是

    http://10.121.3.192/yum/centos6/
    http://10.121.3.192/yum/localrepo6/
    
    

    把这两个 yum 源添加到 repo 文件之后执行 yum install 时会报错

    Error Downloading Packages:
      tree-1.5.3-3.el6.x86_64: failed to retrieve Packages/tree-1.5.3-3.el6.x86_64.rpm from centos6
    error was [Errno 2] Local file does not exist: /etc/yum.repos.d/-d/Packages/tree-1.5.3-3.el6.x86_64.rpm
    
    

    在网上查阅资料之后说需要修改 /usr/lib/python2.6/site-packages/yum/yumRepo.py 文件 将 url 修改成 yum 源的地址

     806 
     807             remote = url +"/" + relative
     808 
     809             try:
    
    
     806 
     807             remote = "http://10.121.3.1922/yum/centos6/" + relative
     808 
     809             try:
    
    
    

    但是这个 remote 只能写一个地址,另外一个 yum 源就无法使用了。 请问各位大神,有没有什么好办法解决

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3096 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:37 · PVG 22:37 · LAX 07:37 · JFK 10:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.