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
How to resolve these errors.
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
How to resolve these errors.
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:
First, we will install PostgreSQL from the source. The following instructions are valid for PostgreSQL versions 11 and 12.
You can also take help from the following link PostgreSQL Documentation:
Download the files in your specified folder
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
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.
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.
If you want to install PostgreSQL using package management, run sudo apt install postgresql-12 postgresql-server-dev-12
.
Try to run this:
sudo apt install postgresql-12 postgresql-server-dev-12
OR
Download the desired version from here and unzip it using tar
keyword in your desired directory.
After that, you will see Makefile in that unzipped folder, now run make install
to install it on your system.
After successful installation, verify it using psql --version
.
I hope this answers your question.