今天尝试更新了下虚拟机CentOS中的python版本后。

运行“yum”命令,就报错:“sudo: unable to execute /bin/yum: No such file or directory”

查询了下网上的资料发现,原来yum调用是用python写的。遂想起刚刚更新python版本,忘了修改yum配置文件了。

解决办法:修改yum配置文件 

[root@localhost ~]#vim /usr/bin/yum

把文件头部的#!/usr/bin/python改成#!/usr/bin/python_old   //改为之前的老版本号 。

保存退出,yum即可正常使用。

如若有其他命令、软件不能正常使用,仿照yum配置文件的修改方法,修改其配置文件即可。

CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory的更多相关文章

  1. sudo: unable to execute ./xxx.py: no such file or directory

    $ ./mk_dataset.py -bash: ./mk_dataset.py: /home/ocean1101/anaconda3/bin/python^M: bad interpreter: N ...

  2. sudo: unable to execute ./script.sh: no such file or directory

    I just had this exact problem, it turned out to be a text file encoding problem. For me to fix it wh ...

  3. Ubuntu 报错 sudo: unable to resolve host

    Ubuntu 在每次执行命令的时候,会报如下错误: $ sudo sudo: unable to resolve host iZ2zecsdy8flu603bmdg1bZ iZ2zecsdy8flu6 ...

  4. centos 7安装mysql报错-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory

    [root@localhost mysql]# ./scripts/mysql_install_db  --user=mysql -bash: ./scripts/mysql_install_db: ...

  5. Centos7 安装Redis,报错[adlist.o] Error jemalloc/jemalloc.h: No such file or directory

    redis官网 https://redis.io/download 安装 $ wget http://download.redis.io/releases/redis-5.0.4.tar.gz $ t ...

  6. ssh登录locale报错:cannot change locale (zh_CN.UTF-8): No such file or directory

    一.登录ssh报错: Last :: from 172.28.146.109 -bash: warning: setlocale: LC_ALL: cannot change locale (en_C ...

  7. git报错remote: error: cannot run hooks/post-receive: No such file or directory

    错误情况如下图所示: 如果你也显示这个错误但是其实在该路径上有上有这个文件,那么显然你遇到和我一样的情况,即你是Windows下创建的文件,但是试图在Lunix系统去打开它.这是在Windows下调用 ...

  8. navicate for mysql命令中输入中文报错

    insert into xsxx(name,xb) values('李四','男') 错误提示: [SQL]insert into xsxx3(name,xb) values('李四','男') [E ...

  9. SSH项目中使用struts-tags报错According to TLD or attribute directive in tag file, attribute test does not accept any expressions

    在运行struts2标签页面时报错,代码如下:<%@ page language="java" pageEncoding="gbk"%><%@ ...

随机推荐

  1. SQL数据库约束行为---防止数据完全重复

    防止同一条数据完全重复: 一.主关键字约束:主键约束.1.能够唯一的区分每一行数据.——不许重2.表中的数据按照主键字排序的.——有序3.主键字不能为空——不为空4.一个表只能有一个主键,但可以设置组 ...

  2. GMT时间转换

    /// <summary> /// GMT时间转成本地时间 /// </summary> /// <param name="gmt">字符串形式 ...

  3. 【leetcode❤python】66. Plus One

    class Solution:      # @param digits, a list of integer digits      # @return a list of integer digi ...

  4. include_path详细解析

    include_path详细解析     原文地址:http://www.laruence.com/2010/05/04/1450.html 1.php默认的包含路径为 .;C:\php\pear 即 ...

  5. hihoCoder太阁最新面经算法竞赛17

    比赛链接:http://hihocoder.com/contest/hihointerview26 A.排序后枚举两个点,确定一个矩形后二分剩下两个点. #include <bits/stdc+ ...

  6. nancy的诊断2

    接上文. 一 再看看第二个面板内容 点击带文号 的  Interactive Diagnostics 这个面板 如下 上面的是诊断程序,默认是系统提供的测试用的诊断程序.  你可以 通过实现IDiag ...

  7. LTE Module User Documentation(翻译4)—— 使用 Fading Trace

    LTE用户文档 (如有不当的地方,欢迎指正!) 7 使用 Fading Trace   本节描述如何在 LTE 仿真中使用 fading traces .   (1)生成 Fading Traces  ...

  8. AFNetworking请求中含有中文时程序崩溃

    出现error: Assertion failure in -[AFHTTPRequestSerializer requestWithMethod:URLString:parameters:error ...

  9. [转载] linux 速查表

    原文: http://www.nixtutor.com/linux/all-the-best-linux-cheat-sheets/ 1. Linux Command Line Linux Refer ...

  10. web设计经验<六>令网站看起来不专业的10个设计误区

    不管你是不是一个羽翼未丰企业的领导,专业的网站能为你带来的东西比你想象的多很多.退一万步来说,“考虑到我们是一个小厂”,粗糙的网站也许能被用户理解,但是不一定能接受.每天大家所浏览的大量的网站,已经从 ...