zoukankan      html  css  js  c++  java
  • yum安装指定路径和配置文件出错

    错误提示如下

    [root@newings yum.repos.d]# yum -c /etc/yum.conf --installroot=/usr/local/wget install wget -y
    Loaded plugins: fastestmirror
    Determining fastest mirrors
     * base: mirrors.aliyun.com
     * extras: mirrors.aliyun.com
     * updates: mirrors.aliyun.com
    http://mirrors.aliyun.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
    Trying other mirror.
    http://mirrors.cloud.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.cloud.aliyuncs.com'"
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

    解释下两个参数

    -c /etc/yum.com #指定Yum配置文件地址
    --installroot=/usr/local/wget #指定所安装软件的路径

    该错误是由于$releasever和$basearch这两个变量中任何一个无法识别都会出现上面的错误,所以在配置yum源的时候首先要确认这两个变量是否存在。

    如果变量不存在就用数字6和i386/x86_64代替。

    我的配置如下

    [base]
    name=CentOS-6 - Base - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/6/os/x86_64/
            http://mirrors.aliyuncs.com/centos/6/os/x86_64/
            http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #released updates 
    [updates]
    name=CentOS-6 - Updates - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/6/updates/x86_64/
            http://mirrors.aliyuncs.com/centos/6/updates/x86_64/
            http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #additional packages that may be useful
    [extras]
    name=CentOS-6 - Extras - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/6/extras/x86_64/
            http://mirrors.aliyuncs.com/centos/6/extras/x86_64/
            http://mirrors.cloud.aliyuncs.com/centos/6/extras/x86_64/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-6 - Plus - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/6/centosplus/x86_64/
            http://mirrors.aliyuncs.com/centos/6/centosplus/x86_64/
            http://mirrors.cloud.aliyuncs.com/centos/6/centosplus/x86_64/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
     
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-6 - Contrib - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/6/contrib/x86_64/
            http://mirrors.aliyuncs.com/centos/6/contrib/x86_64/
            http://mirrors.cloud.aliyuncs.com/centos/6/contrib/x86_64/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

    参考博客

  • 相关阅读:
    vue-cli搭建项目结构及引用bootstrap
    万年历案例
    art-template模板渲染及其过滤器
    字符串中全角半角之间的转换
    大话主席(superslide和 touchslide)插件的使用
    JS中对URL进行转码与解码
    animate.css引入实现动画效果
    [MySQL]group by 与 having 结合函数 的统计技巧
    [HTTP] 基本认证的工作流程
    [HTTP]Etag的工作流程
  • 原文地址:https://www.cnblogs.com/Roobbin/p/10436517.html
Copyright © 2011-2022 走看看