phenomenon
After installing a git from the source code today, the following error was reported after executing the git command:
$ git - version -bash: /usr/bin/git: No such file or directory
Analysis process
At first I thought it was a problem with the PATH path. Checking the PATH path found that it was normal, and it shouldn’t be the case when the command could not be found.
$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/admin/ bin $ abcd - bash: ABCD: the Command not found $ /usr/local/bin/git - version git version 2.17 . 0
It can be seen that the git command is under the PATH path and should be installed normally, because the absolute path can be used normally
And the error that the command cannot be found should be command not found
As the root user, it is normal to execute git –version. At first, I thought it was the admin user who set some variables, which led to the fixed search under /usr/bin when executing the git command.
Later, I found out that there is no such parameter
Finally found the answer on stackoverflow, the link is as follows:
It turns out that the old git path I uninstalled in advance is /usr/bin/git, and then the newly installed git is under /usr/local/bin, and the terminal session saves the original path. Reopen the new terminal to solve the problem.
Read More:
- [Solved] /usr/bin/ld: cannot find crti.o: No such file or directory & /usr/bin/ld: cannot find -lc
- [Solved] Cannot find command ‘git‘ – do you have ‘git‘ installed and in your PATH?
- Ubuntu sub process/usr/bin/dpkg returned an error code (1) solution
- [Solved] Fatal error: GLOG/logging. H: there is no such file or directory
- How to Fix Linux sub process /usr/bin/dpkg returned an error code (1)
- [Solved] Any Softwares Install Error in Ubuntu: /usr/bin/dpkg returned an error code
- [Solved] /usr/local/libexec/mecab/mecab-dict-index: error while loading shared libraries: libmecab.so.2: cannot open shared object file: No such file or directory
- [Solved] nginx: [error] open() “/usr/local/nginx/nginx.pid” failed (2: No such file or directory)
- [Solved] fatal: not a git repository (or any of the parent directories): .git
- [Ubuntu] How to Solve dpkg Error: dpkg: error: failed to open package info file ‘/usr/local/var/lib/dpkg/status’ for reading: No such file or directory
- [Solved] tar (child): bzip2: Cannot exec: No such file or directory tar (child): Error is not recoverable: ex
- /usr/bin/ssh-copy-id: ERROR: No identities found [How to Solve]
- [Solved] ××: error while loading shared libraries: ××.so.19: cannot open shared object file: No such file or directory
- petalinux-build Error: ERROR: Task (/opt/pkg/petalinux/components/yocto/source/aarch64/layers/meta-xilinx-tools/recipes-bsp/fsbl/fsbl_git.bb:do_compile) failed with exit code ‘1’
- [How to Solve] ffprobe ‘***: No such file or directory‘
- [Solved] Python Import mmcv Warning: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- [Solved] Git push error: failed to push some refs to ‘[email protected]:daisy_yangyang/fed-e-task-04-01.git‘
- Error: loading shared libraries: cannot open shared object file: No such file or directory
- Git Syntax Error: TypeError: this.getOptions is not a function [How to Solve]
- [Solved] gcc: error trying to exec ‘cc1‘: execvp: No such file or directory