zoukankan      html  css  js  c++  java
  • yum 报错 [Errno 14] Could not open/read file:///media/iso/repodata/repomd.xml

    yum执行安装命令报错  

     1.yum安装时,需要确定安装源,安装源的配置在/etc/yum.repos.d/中,每个源对应一个文件(以.repo为后缀),如果只配置了本地源,而此时安装光盘(即ISO文件)没有挂载的话自然无法找到安装文件

    此时要么挂载ISO至指定目录,要目就配置新的网络安装源

    2.新建网络安装源配置,名字CentOS-Base.repo

    # CentOS-Base.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client.  You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the 
    # remarked out baseurl= line instead.
    #
    #
    
    [base]
    name=CentOS-$releasever - Base
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    
    #released updates 
    [updates]
    name=CentOS-$releasever - Updates
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-$releasever - Contrib
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
    baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    3.执行命令

    yum clean all
    yum makecache

    4 如果出现

       [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'ftp.sjtu.edu.cn'"

       修改 /etc/resolv.conf
       添加一个nameserver 8.8.8.8完成

     

  • 相关阅读:
    EventBus (四) Sticky事件
    EventBus (三) 源码解析 带你深入理解EventBus
    EventBus (二) 使用详解——EventBus使用进阶
    EventBus (一) 使用详解——初步使用EventBus
    Android布局优化之ViewStub、include、merge使用与源码分析
    Android API 中文(14) —— ViewStub
    ViewStub用法
    FaceBook推出的Android图片加载库-Fresco
    WinForm打印之页边距
    带参数的多线程的方式
  • 原文地址:https://www.cnblogs.com/canger/p/12509847.html
Copyright © 2011-2022 走看看