CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory

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

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

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

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

[[email protected] ~]#vim /usr/bin/yum

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

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

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

时间: 2024-08-05 02:35:53

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

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: No such file or directory $ sudo ./mk_dataset.py  sudo: unable to execute ./mk_dataset.py: No such file or directory  Hangup   这种现象是由于在pycharm中写的代码默认li

unable to execute ./start.sh: No such file or directory

刚编写的一个shell文件执行时突然遇到shell文件不能运行,一下子觉得奇了怪了,明明写的shell文件,而且添加了可执行权限,竟然提示这个结果:如下 [[email protected]-2812 opt]$ sudo ./my.sh sudo: unable to execute ./my.sh: No such file or directory 尝试对文件的用vim打开该sh文件,输入:set ff ,显示fileformat=unix,说明没有问题(如果显示fileformat=do

运行报错:Unable to execute dex: java.nio.BufferOverflowException

今天在网上下载了一个Demo,导入运行时报错,信息如下: [2015-03-01 21:09:24 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace. [2015-03-01 21:09:24 - BinderService] Conversion to Dalvik format failed: Unable to execut

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

一.登录ssh报错: Last login: Tue Apr 23 03:42:01 2019 from 172.28.146.109 -bash: warning: setlocale: LC_ALL: cannot change locale (en_CN.UTF-8): No such file or directory -bash: warning: setlocale: LC_ALL: cannot change locale (en_CN.UTF-8) -bash: warning:

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

错误情况如下图所示: 如果你也显示这个错误但是其实在该路径上有上有这个文件,那么显然你遇到和我一样的情况,即你是Windows下创建的文件,但是试图在Lunix系统去打开它.这是在Windows下调用CentOS上文件显示的结果,如果你还有疑虑可以尝试在CentOS直接打开该文件,那么你将会遇到下面的错误: -bash: hooks/post-receive: /bin/bash^M: bad interpreter: No such file or directory 因为各个操作系统的文件对

Ubuntu 报错 sudo: unable to resolve host

使用SSH连接阿里云的轻量应用型服务器 Ubuntu实例执行命令 sudo su root时,提示: 基本使用sudo开头的命令都会提示此信息,看着比较不爽. 虽然sudo 还是可以正常执行, 但是警告讯息每次都出来,而这只是机器在反解上的问题, 所以就直接从/etc/hosts 设定, 让abc(hostname) 可以解回127.0.0.1 的IP 即可. 解决方案 需要修改/etc/hosts文件: sudo vi /etc/hosts 在 127.0.0.1 localhost 下添加一

Centos编译php5.3报错:libiconv.so.2: cannot open shared object file: No such file or directory

遇见这个错误说明没找到libiconv.so.2文件 1:查看/usr/local/lib下是否有这个库文件,有的话说明已经安装了libiconv,没有说明没有安装 2:若没有安装就下载个安装包,安装好,再测试 3:若已经安装,有两个方法解决 A:在/etc/ld.so.conf中添加/usr/local/lib,再执行一下ldconfig,测试是否可行 B:给libiconv.so.2做个软件链接 ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libi

MAC OS 中mount nfs 报错问题.

记一下 MAC OS 中mount nfs 报错问题. 环境和配置文件 NFS 服务端 Ubuntu 安装 apt install nfs-kernel-server 服务端的配置文件 cat /etc/exports /nfsdata 192.168.22.1/26(rw,sync,insecure,no_root_squash) CentOS 下测试挂载 yum install nfs-utils -y mount -t nfs -o rw 192.168.22.8:/nfsdata /tm

rhel yum报错

用yum报错 http://mirrors.aliyun.com/centos/%24releasever/addons/x86_64/repodata/repomd.xml: [Errno 12] Timeout: <urlopen error timed out> Trying other mirror. http://mirrors.aliyuncs.com/centos/%24releasever/addons/x86_64/repodata/repomd.xml: [Errno 14