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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?