错误:您必须至少安装一个 postgresql-client-;包裹
我正在尝试在 Ubuntu 中安装 PostgreSQL。
我按照以下指示进行操作:
/opt/PostgreSQL/9.0/doc/postgresql/html/installation.html
似乎已成功安装 PostgreSQL,但作为安装后设置,它要求我执行以下操作:
为此,请将以下内容添加到 shell 启动文件中,例如 ~/ .bash_profile
(或 /etc/profile
,如果您希望它影响所有用户):
PATH=/usr/local/pgsql/bin:$PATH
export PATH
但我不知道 .bash_profile 在哪里。它说这不是必需的,所以我跳过了它,当我尝试创建数据库(createdb mydb)时,它给了我
错误:
You must install at least one postgresql-client-<version> package.
我不知道那是什么。谁能解释一下为什么我会收到此错误以及如何安装 postgresql-client ?
I am trying to install PostgreSQL in Ubuntu.
I followed the instruction from:
/opt/PostgreSQL/9.0/doc/postgresql/html/installation.html
and seem to have successfully installed PostgreSQL but as Post-Installation setup, it asked me to do the following:
To do this, add the following to your shell start-up file, such as ~/.bash_profile
(or /etc/profile
, if you want it to affect all users):
PATH=/usr/local/pgsql/bin:$PATH
export PATH
but I have no idea where .bash_profile is. It said this is not required, so I just skipped it and when I was trying to create database (createdb mydb), it gives me
Error:
You must install at least one postgresql-client-<version> package.
I have no idea what that is. Could anyone explain why I am getting this error and how I can install postgresql-client?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您不想指定版本,可以使用它
You can use this if you don't want to specify the version
您现在真的需要9.0吗?否则,请使用优秀的预构建软件包,例如
我在 Ubuntu 10.10 下拥有的软件包。
如果必须是 9.0,您可能最好从 Debian 软件包源重建。
Do you really need 9.0 right now? Otherwise use the excellent pre-built packages eg
is what I have under Ubuntu 10.10.
If it has to be 9.0, you are probably best off rebuilding from the Debian package sources.
您收到“您必须至少安装一个...”错误,因为您使用的是基于 Debian 的系统 (Ubuntu),并且安装了 postgresql-client-common 软件包,但没有提供二进制版本的软件包,例如 postgresql -client-8.4,已安装。
您可以只安装 postgresql-client 软件包,它会自动安装 PostgreSQL 当前支持的数据库客户端软件包版本。
我不知道您使用的是哪个 Ubuntu 版本,也不知道默认情况下它附带的 PostgreSQL 版本是什么,但您最好不要使用 Ubuntu/Debian 版本的 Ubuntu 中的客户端程序,而是修改 PATH 以使用已安装的版本。
.bash_profile 与 .bashrc 类似。如果已创建,它们通常都位于您的主目录中。
You are getting the "You must install at least one..." error because you are on a Debian based system (Ubuntu) and have the postgresql-client-common package installed but do not have the binary-providing versioned package, eg postgresql-client-8.4, installed.
You could just install the postgresql-client package which automatically installs the currently supported database client package version for PostgreSQL.
I don't know what Ubuntu release you are using or what PostgreSQL version it comes with by default, but you may be better off not using client programs from the Ubuntu/Debian version of Ubuntu and instead modifying your PATH to use the installed version.
The .bash_profile is similar to .bashrc. They are both commonly in your home directory if they have been created.
您可以尝试将其添加到 ~/.bashrc (即 /home/youruser/.bashrc)。
或者
从终端 运行:该文件应该已经包含一些代码,但您可以在文件末尾添加,然后保存文件,然后就可以开始了。
哦..并在执行此操作后重新登录,以便可以设置并导出 $PATH 或仅从
终端运行而无需重新登录。应该可以工作...:)
You can try adding this to ~/.bashrc (i.e. /home/youruser/.bashrc).
Or run:
from the terminal. The file should already contain some code, but you can add at the end of the file, then save the file and you should be good to go.
Oh.. and relog after doing this so that $PATH can be set up and exported or just run
from the terminal without relogging. Should work... :)