【问题标题】:Vagrant -bash: psql: command not found on Windows - Git BashVagrant -bash:psql:在 Windows 上找不到命令 - Git Bash
【发布时间】:2017-11-19 21:19:26
【问题描述】:

我尝试在运行vagrant up 命令然后运行vagrant ssh 命令后运行psql 命令

$ vagrant ssh
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-75-generic i686)

0 packages can be updated.
0 updates are security updates

Last login: Sat Jun 17 02:55:00 2017 from 10.0.2.2

vagrant@vagrant:~$ psql
-bash: psql: command not found

`

我尝试了以下解决方案:

psql: command not found Mac

PostgreSQL command psql not found, trouble adding to $PATH

用locate psql命令放我自己的PATH

/usr/share/bash-completion/completions/psql 

但还是没有找到psql

有什么帮助吗?

【问题讨论】:

    标签: postgresql vagrant psql


    【解决方案1】:

    您需要在虚拟机上安装 psql,为此您需要安装 postgresql 和 postgresql-contrib 包,如下所示:

    $ vagrant ssh
    Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-75-generic i686)
    
    0 packages can be updated.
    0 updates are security updates
    
    Last login: Sat Jun 17 02:55:00 2017 from 10.0.2.2
    
    vagrant@vagrant:~$ sudo apt-get update
    vagrant@vagrant:~$ sudo apt-get install postgresql postgresql-contrib
    

    【讨论】:

      猜你喜欢
      • 2016-08-16
      • 1970-01-01
      • 1970-01-01
      • 2018-12-16
      • 2018-08-06
      • 1970-01-01
      • 2019-03-31
      • 1970-01-01
      • 2016-06-09
      相关资源
      最近更新 更多