sudo: run: command not found
时间: 2024-01-05 10:20:36 浏览: 43
当出现"sudo: run: command not found"错误时,可能是因为系统中没有安装sudo或者sudo命令的路径没有正确配置。以下是两种解决方法:
1. 安装sudo命令:
```shell
apt-get update
apt-get install sudo
```
2. 配置sudo命令的路径:
在/etc/sudoers文件中增加一行配置:
```shell
Defaults secure_path="/bin:/usr/bin:/usr/local/bin:..."
```
其中,将"..."替换为系统中实际存在的路径。
相关问题
sudo: ./: command not found
当在Linux系统中使用sudo命令时出现"sudo: ./: command not found"的错误提示时,可能是由于以下原因导致的:
1. 命令路径错误:请确保你输入的命令路径是正确的。如果你使用的是相对路径,请确认当前工作目录是否正确。如果你使用的是绝对路径,请确认路径是否正确。
2. 命令不存在:请确认你输入的命令是否存在。你可以使用which命令来检查命令是否存在于系统的可执行路径中。例如,使用以下命令检查sudo命令是否存在:
```shell
which sudo
```
如果which命令没有返回任何结果,说明sudo命令不存在于系统的可执行路径中。你可以尝试重新安装sudo命令。
3. 权限问题:请确保你有足够的权限来执行sudo命令。sudo命令需要root或者具有sudo权限的用户才能执行。如果你不是root用户,你需要确认你的用户是否具有sudo权限。你可以使用以下命令来检查当前用户是否具有sudo权限:
```shell
sudo -l
```
如果该命令返回"User <username> is not allowed to run sudo on <hostname>."的错误信息,说明你的用户没有sudo权限。你可以联系系统管理员来获取sudo权限。
如果你已经确认了以上问题,但仍然无法解决"sudo: ./: command not found"的错误提示,请提供更多的上下文信息,以便我能够更好地帮助你解决问题。
centos7 sudo: psql: command not found
The error "sudo: psql: command not found" indicates that the "psql" command is not available on your system or it is not in the system's PATH.
To install the PostgreSQL client tools on CentOS 7, you can run the following command:
```
sudo yum install postgresql
```
Once the installation is complete, you should be able to run the "psql" command with sudo privileges. If you still encounter the same error, you may need to add the PostgreSQL client tools directory to your system PATH.
On CentOS 7, you can do this by adding the following line to the end of your `~/.bashrc` file:
```
export PATH=$PATH:/usr/pgsql-<version>/bin
```
Replace `<version>` with the version number of PostgreSQL that you have installed. After saving the file, run `source ~/.bashrc` to reload the PATH configuration.