错误:您必须至少安装一个 postgresql-client-;包裹

发布于 2024-10-22 01:21:32 字数 621 浏览 1 评论 0原文

我正在尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦幻之岛 2024-10-29 01:21:32

如果您不想指定版本,可以使用它

sudo apt-get install postgresql-client

You can use this if you don't want to specify the version

sudo apt-get install postgresql-client
牵你的手,一向走下去 2024-10-29 01:21:32

您现在真的需要9.0吗?否则,请使用优秀的预构建软件包,例如

sudo apt-get install postgresql-8.4 postgresql-client-8.4

我在 Ubuntu 10.10 下拥有的软件包。

如果必须是 9.0,您可能最好从 Debian 软件包源重建。

Do you really need 9.0 right now? Otherwise use the excellent pre-built packages eg

sudo apt-get install postgresql-8.4 postgresql-client-8.4

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.

瑾夏年华 2024-10-29 01:21:32

您收到“您必须至少安装一个...”错误,因为您使用的是基于 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.

南风几经秋 2024-10-29 01:21:32

您可以尝试将其添加到 ~/.bashrc (即 /home/youruser/.bashrc)。

或者

gedit ~/.bashrc

从终端 运行:该文件应该已经包含一些代码,但您可以在文件末尾添加,然后保存文件,然后就可以开始了。

哦..并在执行此操作后重新登录,以便可以设置并导出 $PATH 或仅从

PATH=/usr/local/pgsql/bin:$PATH 
export PATH

终端运行而无需重新登录。应该可以工作...:)

You can try adding this to ~/.bashrc (i.e. /home/youruser/.bashrc).

Or run:

gedit ~/.bashrc

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

PATH=/usr/local/pgsql/bin:$PATH 
export PATH

from the terminal without relogging. Should work... :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文