YumRepo Error: All mirror URLs are not using问题解决

(2013-01-24 02:55:57)

转载
标签:

yumrepo

error

mirror

问题

解决

分类:工作

今天帮同事搭建环境时碰到yum更新出问题了,报如下错误:

YumRepo Error: All mirror URLs are not using ftp, http[s] orfile.
 Eg. $releasever is not a valid release or hasntbeen released yet/
removing mirrorlist with no valid mirrors:/var/cache/yum/base/mirrorlist.txt
Error: Cannot retrieve repository metadata (repomd.xml) forrepository: base. Please verify its path and try again

从字面意思是看是不能正确连接到http或是ftp的真实地址上。

1.有可能是防火墙阻碍了出网http请求或是ftp请求,请检查网关防火墙。

2.有可能是dns不对,无法正常解析,换成8.8.4.4

3.系统取不到Release号

我这里碰到真正的原因是就是3,系统读取不到Release号。

正常一般可以看到版本号

 # lsb_release -a
LSB Version:   :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:   CentOS release 6.2 (Final)
Release:       6.2
Codename:      Final

但是同事的环境上确是,原因就不说了,又想骂人了,哎。

 LSBVersion:   :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: n/a
Description:   n/a
Release:       n/a
Codename:      n/a

而/etc/yum.repos.d下的*.repo源文件中都是baseurl都是带变量的

baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/

所以yum去尝试读取xml文件自然失败了。

 # wget http://mirrors.163.com/centos/%releasever/os/x86_64/repodata/repomd.xml
--2013-01-24 10:50:10--  http://mirrors.163.com/centos/%releasever/os/x86_64/repodata/repomd.xml
Resolving mirrors.163.com... 123.58.173.89, 123.58.173.106
Connecting to mirrors.163.com|123.58.173.89|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-01-24 10:50:11 ERROR 404: Not Found.

所以需要修改*.repo源文件中将$releasever变量全替换成6即可正常yum了。

cat/etc/yum.repos.d/CentOS6-Base-163.repo
# CentOS-Base.repo
[base]
name=CentOS-6 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-6 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-6 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existingpackages
[centosplus]
name=CentOS-6 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

看看这次更新缓存就成功了。

 # yum makecache
base                                  | 3.7kB    00:00    
base/filelists_db                     | 5.9MB    00:04    
base/primary_db                       | 4.5MB    00:03    
base/other_db                         | 2.6MB    00:01    
base/group_gz                         | 211kB    00:00    
extras                                | 3.5kB    00:00    
extras/filelists_db                   |  13kB    00:00    
extras/prestodelta                    | 1.3kB    00:00    
extras/primary_db                     |  23kB    00:00    
extras/other_db                       | 7.9kB    00:00    
updates                               | 3.5kB    00:00    
updates/filelists_db                  | 3.6MB    00:02    
updates/prestodelta                   | 642kB    00:00    
updates/primary_db                    | 4.6MB    00:03    
updates/other_db                      | 473kB    00:00

YumRepo Error: All mirror URLs are not using问题解决相关推荐

  1. YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. /HTML/ 标签: yum 2014-05-26

    YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. </HTML>/ 标签: yum 2014-0 ...

  2. YumRepo Error: All mirror URLs are not using ftp, http[s] or file解决办法

    一.问题背景 CentOS6.5利用yum命令安装程序报错YumRepo Error: All mirror URLs are not using ftp, http[s] or file.Eg. I ...

  3. YumRepo Error_ All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release_repo_arch co

    一.背景 继 CentOS 8 停维后 CentOS 7 也将停止维护! CentOS 8 2021年底停止维护,CentOS 6 2020年底停止维护,CentOS 7 也已于 2020 年底结束整 ...

  4. Git 技术篇 - 同步代码到github失败,提示non-fast-forward、error: failed to push some refs to问题解决方法,git pull的用法

    因为 github 上仓库里删过一些内容,导致本地的仓库和 github 里的对不上了. 此时用 git push 操作就会报 non-fast-forward,error: failed to pu ...

  5. MySql8.0.19最新版本创建用户分配权限演示,You have an error in your SQL syntax权限分配问题解决方法

    MySql 8.0.19 权限分配 问题一:You have an error in your SQL syntax ---语法问题 问题二:You are not allowed to create ...

  6. Error(s) in loading state_dict for ResNet 问题解决

    当使用如下命令加载模型的时候,会报错,没有一些 keys: model.load_state_dict(model_zoo.load_url(model_urls['resnet101'])) Run ...

  7. matlab libjli.so,error while loading shared libraries: libjli.so 问题解决

    问题描述: 执行jar命令,javac命令执行报错 javac: error while loading shared libraries: libjli.so: cannot open shared ...

  8. `LINK : fatal error LNK1104: 无法打开文件“***.dll”`的问题解决

    问题描述: 我在编译动态链接库的项目时候,就报了如下的错误: LINK : fatal error LNK1104: 无法打开文件"..\bin\InitProject.dll" ...

  9. cv2.error: OpenCV(4.5.4-dev) :-1: error: (-5:Bad argument) in function ‘putText‘问题解决

    在python调用cv2.putText的时候报错,具体报错信息如下: Traceback (most recent call last):   File "test.py", l ...

最新文章

  1. springboot添加swagger2组件
  2. cnpm安装webpack_Webpack(一)介绍
  3. 《深入浅出DPDK》读书笔记(四):并行计算-SIMD是Single-Instruction Multiple-Data(单指令多数据)
  4. Python Day42
  5. perl 操作 timesten 数据库 带用户名和密码验证
  6. 论文:Scalable and accurate deep learning for electronic health records研读笔记
  7. Windows Mobile 6 模拟器绿色中文版
  8. 数字信号处理概览与框图
  9. 最新腾讯防水墙滑块验证码破解,代码可以直接运行
  10. 【欣赏】一组唯美的图片
  11. nginx过滤HttpHeader的 中划线
  12. 华为云服务治理 | 隔离仓的作用
  13. mysql ssl 2026_解决连接到 Amazon RDS for MySQL 或 Aurora 实例时的 ERROR 2026 SSL 连接错误...
  14. 开源二维码QR CODE编码/解码(识别)库
  15. threejs 绘制球体_Three.js基础探寻四——立方体、平面与球体
  16. 新页面中返回到上次浏览的页面位置
  17. springboot+vue3物资管理系统实战
  18. box-shadow实现内部阴影
  19. Python中字符串和二进制互转
  20. react视频播放组件Griffith的基本使用

热门文章

  1. 其实大学老师在剑桥读博士,好像录取不难
  2. 关于VS附加调试Unity引起卡顿无响应问题
  3. C++返回栈上的数组(局部变量)问题探索
  4. 【转】dijkstra算法
  5. 助力航天元器件管理“高可靠降成本”,赛思库获数千万元Pre-A轮融资
  6. 正则表达式-趣现象一则
  7. 韩国IT业是怎么走向国际我们须要学习什么
  8. 《Adobe Dreamweaver CC经典教程》——导读
  9. 我喜欢的JavaScript编程风格
  10. [实战演练]腾讯2013年校招软件开发类笔试题目(选择题部分)