Yum:[Errno 5] [Errno 2] No such file or directory

yum安装软件时,可以连接yum 仓库,但是下载安装时失败,报错如下

[email protected]/0 # yum install httpd
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors-internal.yyhu.com
 * extras: mirrors-internal.yyhu.com
 * updates: mirrors-internal.yyhu.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-67.el7.centos.6 将被 安装
--> 解决依赖关系完成

依赖关系解决

==========================================================================================================================================================================================
 Package                                 架构                                     版本                                                    源                                         大小
==========================================================================================================================================================================================
正在安装:
 httpd                                   x86_64                                   2.4.6-67.el7.centos.6                                   updates                                   2.7 M

事务概要
==========================================================================================================================================================================================
安装  1 软件包

总下载量:2.7 M
安装大小:9.4 M
Is this ok [y/d/N]: y
Downloading packages:

Error downloading packages:
  httpd-2.4.6-67.el7.centos.6.x86_64: [Errno 5] [Errno 2] 没有那个文件或目录

这个是因为系统之前升级过python,原来版本是2.7,升级python3后,yum 调用python找不到2.7的版本了

有两个配置文件需要修改

/usr/bin/yum
/usr/libexec/urlgrabber-ext-down

分别将文件开头的声明路径改正确,改回2.7的版本

#! /usr/bin/env python2.7

原文地址:http://blog.51cto.com/chaichuan/2083574

时间: 2024-08-30 17:37:49

Yum:[Errno 5] [Errno 2] No such file or directory的相关文章

/usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

问题:当你执行yum 命令时提示如下错误:/usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory解决方法:上面的提示说明yum脚本没有找到python命令.只要找到python命令的路径,然后建立个软链接即可.如:sudo ln -s /usr/bin/python2.4 /usr/bin/pythonps:yum命令是用python脚本写的.打开yum脚本,你可以看到. /usr/bin/yum: /u

-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

报错:-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory python多版本造成额问题 找不到python的路径 所以保持 -查找python#whereis pythonpython: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 /usr/local/bin/python2.7 /usr/local/bin/python

webpack编译报错:Module not found: Error: Cannot resolve 'file' or 'directory' ./../../node_modules..

在同事的mac电脑上,可以正常编译,拿到我这边就出错了(⊙﹏⊙) 好像是webpack在window下的一个bug,需要让 webpack 和你的项目保持在一个盘符下,参考. 解决方法: 修改config.js配置文件,在所有目录前加上path.join,参考1,参考2. webpack编译报错:Module not found: Error: Cannot resolve 'file' or 'directory' ./../../node_modules..

解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题

参考: How to install all the boost development libraries? 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题 在安装boost时,步骤./b2出现如下错误: gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.9.4/release/link-static/threading-multi/bzip2.o libs/iostr

解决mac os下mcss命令报错:env: node\r: No such file or directory

标题无“转载”即原创文章,版权所有.转载请注明来源:http://besteam.im/blogs/article/31/. 我一直对字符界面有抵触感,即使会用vim,我的linux脚本(python/bash script)一般都是在windows下写完调试好,然后传到linux上的. 不过写好的linux脚本传到linux上运行的时候却经常报这样的错: $ cat fish.py #!/usr/bin/env python print "fish" $ chmod u+x fish

yum install 报错[Errno 14] curl#37 - Couldn't open file /mnt/repodata/repomd.xml

1.然后按照网上的一些修改,先是执行: yum cleam all 然后 yum makecache,问题还是没解决,继续报错. 其实这两条命令就是清空缓存,然后再重新缓存的意思,有时候可能有效. 2.然后又尝试了方法,说是DNS的问题,上不了网.又去改了DNS(可以去尝试尝试,因为不同人遇到问题不一样). 如果是绑定了静态地址,直接修改/etc/resolv.conf   这个文件下的DNS是没有用的,因为你执行命令service network restart 会恢复.所以要修改网卡的配置文

yum 安装时错误 Errno 14 Couldn't resolve host 解决办法

是由于DNS解析错误引起的 修改/etc/resolv.conf 添加一个nameserver 8.8.8.8完成 yum 安装时错误 Errno 14 Couldn't resolve host 解决办法

GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-

今天更新为163的源后,yum的时候报错:GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5. 解决方案:vi /etc/yum.repos.d/CentOS-Base.repo 把文件里所有的RPM-GPG-KEY-CentOS-5更改为RPM-GPG-KEY-CentOS-6就可以了 vim 替换 :%s/RPM-GPG-KEY-CentOS

ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory

命令: ansible -i hosts_20 st  -m shell -a 'service zabbix_agentd star'  -K --become ansible -i hosts_20 st  -m shell -a 'lsof -i:10050'  -K --become 在shell模块报错:| FAILED | rc=127 >>/bin/sh: lsof: command not found 在command模块报错:| rc=2 >>[Errno 2]