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

    参考博客

  • 相关阅读:
    Linux下管道编程
    【Windows】用信号量实现生产者-消费者模型
    初识【Windows API】--文本去重
    HDU 5183 Negative and Positive (NP) --Hashmap
    【ASC 23】G. ACdream 1429 Rectangular Polygon --DP
    UVALive 4670 Dominating Patterns --AC自动机第一题
    POJ 2225 / ZOJ 1438 / UVA 1438 Asteroids --三维凸包,求多面体重心
    我也来写2014年总结
    UVALive 4870 Roller Coaster --01背包
    UVALive 4864 Bit Counting --记忆化搜索 / 数位DP?
  • 原文地址:https://www.cnblogs.com/Roobbin/p/10436517.html
Copyright © 2011-2022 走看看