【ERROR】bash: vim: command not found的解决办法
时间: 2023-08-28 07:05:26 浏览: 110
这个错误一般是因为系统中没有安装vim编辑器导致的,你可以使用以下步骤尝试解决:
1. 在终端中输入以下命令安装vim编辑器:
- Ubuntu/Debian系统:sudo apt-get install vim
- CentOS/RHEL系统:sudo yum install vim
2. 如果你已经安装了vim编辑器,但仍然出现这个错误,可以尝试输入以下命令重新安装vim编辑器:
- Ubuntu/Debian系统:sudo apt-get --purge remove vim && sudo apt-get install vim
- CentOS/RHEL系统:sudo yum remove vim && sudo yum install vim
3. 如果以上两步仍然无法解决问题,可以尝试查看你的环境变量中是否包含了vim编辑器的路径,如果没有,则需要手动添加。
希望这些方法能够帮助你解决问题。
相关问题
vim/etc/vim/vimrc: command not found
您在执行vim的时候出现了"vim/etc/vim/vimrc: command not found"的错误信息。这个错误通常是由于vim配置文件(vimrc)中存在语法错误或者文件路径错误导致的。根据您提供的引用内容,可以看到出现了几个与vim配置文件相关的错误。
首先,在引用中,执行了"source ~/.vimrc"后出现了一系列的错误信息,其中包括了"/etc/vim/vimrc: line 21: syntax error near unexpected token `"syntax"'"的错误。这个错误提示表明在vim配置文件的第21行附近存在一个语法错误,可能是由于缺少或者多余的引号导致的错误。
另外,在引用中,执行了"silent! if plug#begin('~/.vim/plugged')"后同样出现了语法错误,错误信息为"/root/.vimrc: line 13: syntax error near unexpected token `('"。这个错误提示表明在vim配置文件的第13行附近存在一个语法错误,可能是由于缺少或者多余的括号导致的错误。
综上所述,您在执行vim时遇到的"vim/etc/vim/vimrc: command not found"的错误是由于vim配置文件中存在语法错误导致的。您需要检查vim配置文件中的语法并进行修正,确保所有的引号和括号都是成对出现的,并且没有多余或者缺少的情况。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [【解决】source ~/.vimrc出错bash: /etc/vim/vimrc: line 21: syntax error near unexpected token `...](https://blog.csdn.net/u25th_engineer/article/details/100126190)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
This error message indicates that the "yum" command cannot be executed because the Python interpreter it requires is missing or cannot be found in the specified location ("/usr/bin/python").
There are a few possible reasons for this error:
1. Python may not be installed on your system. In this case, you can install Python using your distribution's package manager (e.g. "apt-get install python" on Debian/Ubuntu, or "yum install python" on CentOS/RHEL).
2. The Python executable may have been moved or deleted. Check if the file "/usr/bin/python" exists on your system. If it doesn't, you may need to reinstall Python or create a symbolic link to the correct location.
3. The "yum" script may have a hardcoded path to the Python interpreter that doesn't match your system. You can try editing the script (e.g. with a text editor like "nano" or "vim") and changing the path to the correct location of the Python executable.
Once you have resolved the issue with the Python interpreter, the "yum" command should be able to execute without errors.
阅读全文