Error: You must install at least one postgresql-client-<version> package
Solution 1
You can use this if you don't want to specify the version
sudo apt-get install postgresql-client
Solution 2
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.
Solution 3
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.
Solution 4
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... :)
Related videos on Youtube
Guest
Updated on July 09, 2022Comments
-
Guest almost 2 years
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?
-
Guest about 13 yearsAnd I just realised that my Postgresql-9.0.2 folder doesn't have a bin folder!
-
-
Dirk Eddelbuettel about 13 yearsIf you use the packaged versions you can safely run several instances and versions at the same time, e.g. I had 8.2 and 8.3 running in parallel for a while. Your 9.0 install however is outside of that so I would remove it from /usr/local or /opt or whereever it installed it.
-
DrColossos about 13 yearsThere is a 9.x package available from launchpad launchpad.net/~pitti/+archive/postgresql that install like 8.4 from the "official" repository. 9.x will be default in Ubuntu 11.04. And no, 9.0 does not depend on 8.4.
-
Dirk Eddelbuettel about 13 yearsThat may be a safe bet as it is maintained by the same guy / follows the same conventions. I have upgraded Postgresql from versions 5.* on Debian systems and have been really happy.
-
Guest about 13 yearsHow do I access /usr/local from the terminal?