skip to Main Content

I need to install postgres server 11 on ubuntu linux.

because it is recommended during the installation of postgres-11 and apache-age from source code:

i used this command in ubuntu linux

sudo apt install postgresql-server-dev-11

but it gives error:

Unable to locate package postgresql-server-dev-11

can someone please help me

4

Answers


  1. Maybe directory where you have installed PostgreSQL with different name. The path you have installed PostgreSQL is specified when you used the ./configure –prefix={path} command during the installation process. It is commonly stored in /usr/local/ but that will depend on where you have specified the path to be.

    Login or Signup to reply.
  2. On Ubuntu (apt), only these two packages are currently available:

    postgresql-server-dev-12 - development files for PostgreSQL 12 server-side programming
    postgresql-server-dev-all - extension build tool for multiple PostgreSQL versions
    

    So, you can install postgreSQL 12 along with postgresql-server-dev-12

    But it is not necessary to install the postgresql-server-dev-xx package anymore, as the installation of PostgreSQL should already include all the necessary header files.

    The standard installation provides all the header files needed for
    client application development as well as for server-side program
    development, such as custom functions or data types written in C.

    This change was introduced in PostgreSQL 9.2, where the pg_config script was updated to include the necessary compiler and linker flags, so extensions can be built against the PostgreSQL installation without the need for additional packages.

    Login or Signup to reply.
  3. This is probably happening because your version of Ubuntu does not have this package available. You could add the PostgreSQL package repository on your system, add the GPG key of it, and then update the package list. Just use these commands:

    sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
    sudo apt update
    

    And then run your code

    sudo apt install postgresql-server-dev-11
    

    Here’s my reference Setup PostgreSQL 11

    Login or Signup to reply.
  4. Actually, this sudo apt install postgresql-server-dev-xx command varies with the version of Ubuntu.

    Here are some examples:-

    Package postgresql-server-dev-10: ubuntu0.18.04.1

    Package postgresql-server-dev-12: ubuntu0.20.04.1

    Package postgresql-server-dev-14: ubuntu0.22.04.1

    Package postgresql-server-dev-all: This will cover almost all versions of ubuntu

    For more details you can you can refer: Ubuntu-Package Search

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search