centos7 sudo: psql: command not found
时间: 2023-08-02 09:07:00 浏览: 175
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.
阅读全文