centos7 sudo: psql: command not found
时间: 2023-08-02 10:06:33 浏览: 242
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 resolve this issue, you can try installing the PostgreSQL client tools using your operating system's package manager. For example, on CentOS 7, you can run the following command to install the client tools:
```
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.
阅读全文