2

I'm new with Linux systems. I tried to install PostgreSQL 9.2. I did the following:

sudo apt-get update
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update

sudo apt-get -y install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2

But it says that it can't find the packages. I read some tutorials and everywhere was written that I need to use the ppa:pitti/postgresql repository.

What's wrong?

UPDATE1

I successfully installed packages from @slm's answer, but I can't start postgres. When I try psql I get:

Command psql can be found in packages:
 * postgresql-client-common
 * postgres-xc-client

Also I don't see file /etc/init.d/postgresql.

UPDATE2

$ dpkg -L postgresql-contrib-9.2
/.
/usr
/usr/lib
/usr/lib/postgresql
/usr/lib/postgresql/9.2
/usr/lib/postgresql/9.2/lib
/usr/lib/postgresql/9.2/lib/test_parser.so
/usr/lib/postgresql/9.2/lib/btree_gist.so
/usr/lib/postgresql/9.2/lib/pgstattuple.so
/usr/lib/postgresql/9.2/lib/pg_buffercache.so
/usr/lib/postgresql/9.2/lib/cube.so
/usr/lib/postgresql/9.2/lib/unaccent.so
/usr/lib/postgresql/9.2/lib/earthdistance.so
/usr/lib/postgresql/9.2/lib/pgrowlocks.so
/usr/lib/postgresql/9.2/lib/insert_username.so
/usr/lib/postgresql/9.2/lib/moddatetime.so
/usr/lib/postgresql/9.2/lib/isn.so
 /usr/lib/postgresql/9.2/lib/lo.so
/usr/lib/postgresql/9.2/lib/chkpass.so
/usr/lib/postgresql/9.2/lib/passwordcheck.so
/usr/lib/postgresql/9.2/lib/pg_freespacemap.so
/usr/lib/postgresql/9.2/lib/auth_delay.so
/usr/lib/postgresql/9.2/lib/pgcrypto.so
/usr/lib/postgresql/9.2/lib/pgxml.so
/usr/lib/postgresql/9.2/lib/btree_gin.so
/usr/lib/postgresql/9.2/lib/seg.so
/usr/lib/postgresql/9.2/lib/tcn.so
/usr/lib/postgresql/9.2/lib/auto_explain.so
/usr/lib/postgresql/9.2/lib/file_fdw.so
/usr/lib/postgresql/9.2/lib/uuid-ossp.so
/usr/lib/postgresql/9.2/lib/refint.so
/usr/lib/postgresql/9.2/lib/dict_int.so
/usr/lib/postgresql/9.2/lib/ltree.so
/usr/lib/postgresql/9.2/lib/tablefunc.so
/usr/lib/postgresql/9.2/lib/dummy_seclabel.so
/usr/lib/postgresql/9.2/lib/dict_xsyn.so
/usr/lib/postgresql/9.2/lib/adminpack.so
/usr/lib/postgresql/9.2/lib/fuzzystrmatch.so
/usr/lib/postgresql/9.2/lib/pg_trgm.so
/usr/lib/postgresql/9.2/lib/pg_stat_statements.so
/usr/lib/postgresql/9.2/lib/autoinc.so
/usr/lib/postgresql/9.2/lib/timetravel.so
/usr/lib/postgresql/9.2/lib/dblink.so
/usr/lib/postgresql/9.2/lib/sslinfo.so
/usr/lib/postgresql/9.2/lib/_int.so
/usr/lib/postgresql/9.2/lib/hstore.so
/usr/lib/postgresql/9.2/lib/pageinspect.so
/usr/lib/postgresql/9.2/lib/citext.so
/usr/lib/postgresql/9.2/bin
/usr/lib/postgresql/9.2/bin/pgbench
/usr/lib/postgresql/9.2/bin/pg_standby
/usr/lib/postgresql/9.2/bin/pg_archivecleanup
/usr/lib/postgresql/9.2/bin/vacuumlo
/usr/lib/postgresql/9.2/bin/pg_test_timing
/usr/lib/postgresql/9.2/bin/pg_test_fsync
/usr/lib/postgresql/9.2/bin/oid2name
/usr/share
/usr/share/doc
/usr/share/doc/postgresql-contrib-9.2
/usr/share/doc/postgresql-contrib-9.2/copyright
/usr/share/doc/postgresql-contrib-9.2/autoinc.example
/usr/share/doc/postgresql-contrib-9.2/changelog.gz
 /usr/share/doc/postgresql-contrib-9.2/changelog.Debian.gz
/usr/share/doc/postgresql-contrib-9.2/moddatetime.example
/usr/share/doc/postgresql-contrib-9.2/refint.example
/usr/share/doc/postgresql-contrib-9.2/insert_username.example
/usr/share/doc/postgresql-contrib-9.2/timetravel.example
 /usr/share/postgresql
/usr/share/postgresql/9.2
/usr/share/postgresql/9.2/extension
/usr/share/postgresql/9.2/extension/pgstattuple.control
/usr/share/postgresql/9.2/extension/uuid-ossp.control
/usr/share/postgresql/9.2/extension/dblink--1.0.sql
/usr/share/postgresql/9.2/extension/dblink.control
/usr/share/postgresql/9.2/extension/timetravel.control
/usr/share/postgresql/9.2/extension/citext.control
/usr/share/postgresql/9.2/extension/xml2--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/isn.control
/usr/share/postgresql/9.2/extension/pageinspect.control
/usr/share/postgresql/9.2/extension/intarray.control
/usr/share/postgresql/9.2/extension/insert_username--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/refint--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/seg--1.0.sql
/usr/share/postgresql/9.2/extension/pg_stat_statements.control
/usr/share/postgresql/9.2/extension/tcn--1.0.sql
/usr/share/postgresql/9.2/extension/refint.control
/usr/share/postgresql/9.2/extension/lo--1.0.sql
/usr/share/postgresql/9.2/extension/pageinspect--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/isn--1.0.sql
/usr/share/postgresql/9.2/extension/tablefunc--1.0.sql
/usr/share/postgresql/9.2/extension/test_parser--1.0.sql
/usr/share/postgresql/9.2/extension/sslinfo--unpackaged--1.0.sql
 /usr/share/postgresql/9.2/extension/moddatetime.control
/usr/share/postgresql/9.2/extension/intagg.control
/usr/share/postgresql/9.2/extension/timetravel--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/insert_username.control
/usr/share/postgresql/9.2/extension/hstore--1.0--1.1.sql
/usr/share/postgresql/9.2/extension/moddatetime--1.0.sql
/usr/share/postgresql/9.2/extension/file_fdw--1.0.sql
/usr/share/postgresql/9.2/extension/tsearch2--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/pg_freespacemap--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/pg_stat_statements--1.0--1.1.sql
/usr/share/postgresql/9.2/extension/isn--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/pg_trgm--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/btree_gist--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/earthdistance--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/refint--1.0.sql
/usr/share/postgresql/9.2/extension/btree_gin--1.0.sql
/usr/share/postgresql/9.2/extension/autoinc.control
/usr/share/postgresql/9.2/extension/pgcrypto.control
/usr/share/postgresql/9.2/extension/pg_trgm.control
/usr/share/postgresql/9.2/extension/btree_gin.control
/usr/share/postgresql/9.2/extension/seg.control
/usr/share/postgresql/9.2/extension/pg_trgm--1.0.sql
/usr/share/postgresql/9.2/extension/hstore--1.1.sql
/usr/share/postgresql/9.2/extension/test_parser.control
/usr/share/postgresql/9.2/extension/dict_xsyn--1.0.sql
/usr/share/postgresql/9.2/extension/sslinfo--1.0.sql
/usr/share/postgresql/9.2/extension/tablefunc--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/tcn.control
/usr/share/postgresql/9.2/extension/lo.control
/usr/share/postgresql/9.2/extension/uuid-ossp--1.0.sql
/usr/share/postgresql/9.2/extension/chkpass.control
/usr/share/postgresql/9.2/extension/btree_gin--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/fuzzystrmatch.control
/usr/share/postgresql/9.2/extension/timetravel--1.0.sql
/usr/share/postgresql/9.2/extension/cube--1.0.sql
/usr/share/postgresql/9.2/extension/dblink--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/insert_username--1.0.sql
/usr/share/postgresql/9.2/extension/ltree--1.0.sql
/usr/share/postgresql/9.2/extension/citext--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/ltree--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/pgstattuple--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/btree_gist--1.0.sql
/usr/share/postgresql/9.2/extension/dict_xsyn.control
/usr/share/postgresql/9.2/extension/pgcrypto--1.0.sql
/usr/share/postgresql/9.2/extension/uuid-ossp--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/pg_buffercache--1.0.sql
/usr/share/postgresql/9.2/extension/unaccent--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/seg--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/file_fdw.control
/usr/share/postgresql/9.2/extension/tsearch2--1.0.sql
/usr/share/postgresql/9.2/extension/fuzzystrmatch--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/lo--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/unaccent--1.0.sql
/usr/share/postgresql/9.2/extension/fuzzystrmatch--1.0.sql
/usr/share/postgresql/9.2/extension/intarray--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/autoinc--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/ltree.control
/usr/share/postgresql/9.2/extension/pg_buffercache--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/cube.control
/usr/share/postgresql/9.2/extension/pgcrypto--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/chkpass--1.0.sql
/usr/share/postgresql/9.2/extension/earthdistance--1.0.sql
/usr/share/postgresql/9.2/extension/pg_stat_statements--1.1.sql
/usr/share/postgresql/9.2/extension/pgrowlocks--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/pgrowlocks--1.0.sql
/usr/share/postgresql/9.2/extension/moddatetime--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/unaccent.control
/usr/share/postgresql/9.2/extension/dict_int--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/intarray--1.0.sql
/usr/share/postgresql/9.2/extension/pgstattuple--1.0.sql
/usr/share/postgresql/9.2/extension/pg_freespacemap--1.0.sql
/usr/share/postgresql/9.2/extension/autoinc--1.0.sql
/usr/share/postgresql/9.2/extension/tsearch2.control
/usr/share/postgresql/9.2/extension/test_parser--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/pageinspect--1.0.sql
/usr/share/postgresql/9.2/extension/pg_freespacemap.control
/usr/share/postgresql/9.2/extension/xml2--1.0.sql
/usr/share/postgresql/9.2/extension/citext--1.0.sql
/usr/share/postgresql/9.2/extension/chkpass--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/hstore--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/dict_int--1.0.sql
/usr/share/postgresql/9.2/extension/hstore.control
/usr/share/postgresql/9.2/extension/intagg--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/xml2.control
/usr/share/postgresql/9.2/extension/pgrowlocks.control
/usr/share/postgresql/9.2/extension/sslinfo.control
/usr/share/postgresql/9.2/extension/cube--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/adminpack--1.0.sql
/usr/share/postgresql/9.2/extension/pg_buffercache.control
 /usr/share/postgresql/9.2/extension/pg_stat_statements--unpackaged--1.0.sql
/usr/share/postgresql/9.2/extension/btree_gist.control
/usr/share/postgresql/9.2/extension/intagg--1.0.sql
/usr/share/postgresql/9.2/extension/adminpack.control
/usr/share/postgresql/9.2/extension/dict_int.control
/usr/share/postgresql/9.2/extension/tablefunc.control
/usr/share/postgresql/9.2/extension/earthdistance.control
/usr/share/postgresql/9.2/man
/usr/share/postgresql/9.2/man/man1
/usr/share/postgresql/9.2/man/man1/pg_test_timing.1.gz
/usr/share/postgresql/9.2/man/man1/pg_test_fsync.1.gz
/usr/share/postgresql/9.2/man/man1/pg_standby.1.gz
/usr/share/postgresql/9.2/man/man1/pgbench.1.gz
/usr/share/postgresql/9.2/man/man1/oid2name.1.gz
/usr/share/postgresql/9.2/man/man1/pg_archivecleanup.1.gz
/usr/share/postgresql/9.2/man/man1/vacuumlo.1.gz
  • What version of Linux Mint are you using? – slm Jul 10 '13 at 7:07
  • @slm:Mint Olivia. – Kliver Max Jul 10 '13 at 7:32
  • The directions I gave you should work then. – slm Jul 10 '13 at 7:37
4

You might want to try the directions described in this post titled: Install latest PostgreSQL on Linux Mint. General steps:

  1. create /etc/apt/sources.list.d/pgdg.list containing:

    deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
    
  2. Import the repository signing key, and update the package lists

    $ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
      sudo apt-key add -
    
  3. Update repository indexes

    $ sudo apt-get update
    
  4. Install postgreSQL (run all these cmds as root)

    $ sudo apt-get install postgresql-9.2
    $ sudo apt-get install postgresql-contrib-9.2
    $ sudo apt-get install pgadmin3
    
  • I install this packages. Create Os user postgres. Make su postgres. But itst says that cant find command psql. – Kliver Max Jul 10 '13 at 7:38
  • @KliverMax - good. The link I provided had more steps for setting the master password and such, so you might want to refer to it for all the steps. Please mark this answer as accepted if your issue's been resolved so others know you're all set. – slm Jul 10 '13 at 7:39
  • :Also i cant find file /etc/init.d/postgresql. – Kliver Max Jul 10 '13 at 7:42
  • @KliverMax - you can use the command dpkg -L <pkg> to list the contents of the packages you just installed. I'll list them out and look for the init.d script to see if it's included. – slm Jul 10 '13 at 7:51
  • i try dpkg -L <pkg> but get syntax error near 'newLine'. – Kliver Max Jul 10 '13 at 7:54
0

If psql is not working, may be it is not there in PATH. Try doing a find for psql and see if it is there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.