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

2017-12-26 19:01:25 +08:00
 grape

我在内网搭建了两个 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 源就无法使用了。 请问各位大神,有没有什么好办法解决

3098 次点击
所在节点    Linux
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/417823

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX