snippetsqlMinor
How do I install PostgreSQL in Debian/Ubuntu?
Viewed 0 times
postgresqlinstallubuntudebianhow
Problem
I'm following these instructions, however I can only get to step 17.2.
Despite installing postgresql successfully via the
command, upon running
Ubuntu tells me that it 'initdb' isn't installed. The instructions tell me this command is installed by
so what's going on?
Despite installing postgresql successfully via the
sudo apt-get install postgresqlcommand, upon running
initdb -D /usr/local/pgsql/dataUbuntu tells me that it 'initdb' isn't installed. The instructions tell me this command is installed by
sudo apt-get install postgresqlso what's going on?
Solution
If you haven't set up the environment variables, then you need to specify the full path to your executables.
What version of Postgresql are you using? You show a link to 8.3 which is many years old. These docs are current: http://www.postgresql.org/docs/current/static/creating-cluster.html
Did you install Postgresql with an up-to-date package, a la http://www.postgresql.org/download/linux/ubuntu/ ?
When installing 9.2 on Ubuntu, I added the following lines to the ~postgres/.bash_profile
Where "/usr/lib/postgresql/9.2/bin" is the path to your 9.2 executables. That made the installation a bit smoother for me.
What version of Postgresql are you using? You show a link to 8.3 which is many years old. These docs are current: http://www.postgresql.org/docs/current/static/creating-cluster.html
Did you install Postgresql with an up-to-date package, a la http://www.postgresql.org/download/linux/ubuntu/ ?
When installing 9.2 on Ubuntu, I added the following lines to the ~postgres/.bash_profile
export PATH=/usr/lib/postgresql/9.2/bin:$PATH:/usr/sbin
export PGDATA=/var/lib/postgresql/9.2/main
export PGPORT=5432Where "/usr/lib/postgresql/9.2/bin" is the path to your 9.2 executables. That made the installation a bit smoother for me.
Code Snippets
export PATH=/usr/lib/postgresql/9.2/bin:$PATH:/usr/sbin
export PGDATA=/var/lib/postgresql/9.2/main
export PGPORT=5432Context
StackExchange Database Administrators Q#52849, answer score: 4
Revisions (0)
No revisions yet.