skip to Main Content

I am downloading PostgreSQL on my Ubuntu version 18.04 and getting these errors while installing Postgresql version 12.

I have ran following command

sudo apt-get install postgresql postgresql-client

enter image description here

How to resolve these errors.

4

Answers


  1. You try execute sudo apt-get update before installation?

    Login or Signup to reply.
  2. Try to run sudo apt-get update before the installation, and if it didn’t work

    I would recommend you download the PostgreSQL from the source by following below instructions:

    Installing dependencies:

    First, we are going to install age
    For that make a new directory and a sub-directory:

    mkdir age_installation
    cd age_installation
    mkdir pg
    cd pg
    

    Download some important libraries by using the below commands before starting the process of installation of Apache Age. Since we are specifically using Linux to install the apache age, we will be using the below commands.

    Remember below commands might vary according to the operating systems.

    sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison

    Installation of PostgreSQL from Source:

    First, we will install PostgreSQL from source. We need an age compatible version of PostgreSQL. For now, age only supports Postgres 11 and 12.

    You can also take help from the following link PostgreSQL Documentation:

    Download the files in the folder age-installation/pg

    wget https://ftp.postgresql.org/pub/source/v11.18/postgresql-11.18.tar.gz && tar -xvf postgresql-11.18.tar.gz && rm -f postgresql-11.18.tar.gz
    

    The command will download and extract the tar files for Linux users from Source in the working directory.
    Installing PG:
    Now we will move toward installing PG

    cd postgresql-11.18
    
    # configure by setting flags
    ./configure --enable-debug --enable-cassert --prefix=$(path) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"
    
    # now install
    make install
    
    # go back
    cd ../../
    

    In the above command, the prefix flag will contain the path where you would like to install the PSQL. Replace your path with the path in the parenthesis.

    Login or Signup to reply.
  3. I face similar problem while trying to install postgresql version 11 , You can check this blog for detailed installation guide with problems and fix ,

    Postgresql installation for Ubuntu – blog

    Hope it helps!

    Login or Signup to reply.
  4. Try the following command

    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-get update
    sudo apt-get -y install postgresql-12
    

    or simply paste this in a .sh file and run that sh file with sudo, postgresql 12 would be installed successfully.

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