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
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.
- Error report when executing ifconfig under centos7
- [Solved] Error in OpenSSL when compiling code locally for raspberry pie
- error while loading shared libraries [How to Solve]
- Nginx error: nginx: [error] invalid PID number ““ in “/run/nginx.pid“
- Linux Nagios failed to log in to internal server error (Fixed)
- Termux setting path environment variable
- The upgrade of Ubuntu results in an error in the compilation of Android Jack [Two Method to Solve]
- Mac opens Terminal and reports an error -bash:: command not found
- How to Use Apt get Command Under Mac OSX
- How to set fixed IP address for Raspberry Pie
- [Solved] Jenkins+Ant Error: Error reading project file xxxxx
- Error: EACCES: permission denied, unlink ‘xxxx/xxxx/xxxx‘ [How to Solve]
- [Solved] Cannot find command ‘git‘ – do you have ‘git‘ installed and in your PATH?
- Ubuntu20.04 install the ROS noetic version in catkin_Problems in make compilation
- [Solved] CUDA driver version is insufficient for CUDA runtime version
- MAC Adb Shell Error: -bash: adb: command not found, adb
- [Solved] /usr/bin/ld: cannot find crti.o: No such file or directory & /usr/bin/ld: cannot find -lc
- Apache Cannot Start: SSL Library Error: -8181 Certificate has expired
- Install and start the tftp-server server and possible solutions to Redirecting to /bin/systemctl restart xinetd.service problems