Pre-Requisites:
-> Log in as root if the password of the root is not known then use this cmd else simply sudo su root.
cmd:su bash
-> Give the password for the current user then it will automatically redirects to the root.
-> Copy the package or binary file of postgresql to the /opt/ folder.
-> If the file is tar then untar using this cmd to extract the file by going to the location.
cmd:cd /opt/
cmd:/opt# tar -xvf postgresql-9.5.8.tar.gz
untar the binary file
-> to check for the extracted file use the cmd then the file will be listed.
cmd:ls -ltr
to see normal file
-> Then go to the location where the package is available by the cmd
cmd:cd /opt/postgresql-9.5.8/
Step1: If we need xml support then configure with libxml else we can configure directly without libxml.
cmd:./configure –with-libxml
step 1
-> If no error came then proceed to step2.
Error: If readline dependent came ..
so installed libreadline-java ,libreadline-java-javadoc and readline-devel library needs to be installed with libreadline
readline error
-> Then run the cmd.
cmd:apt-get install readline
cmd:apt-get install libreadline6 libreadline6-dev
-> Now readline dependencies are available. Again configure
cmd:./configure –with-libxml
->If the error comes for zliblg then use the cmd.
Note:When ever any dependency missing error came then use the cmd with that dependency.
cmd:apt-get install zlib1g-dev

cmd:./configure –with-libxml

Note:If the postgresql is already installed then before make run this cmd.
cmd:make clean
Step2:
cmd:make

after make cmd
Step3:
cmd:make world

after makeworld cmd
Step4:
cmd:make install

after make installl cmd
step5:
cmd:make install-world

after make install-world cmd
-> Now postgresql is installed successfully.
Hint:The default installation directory of postgres available here.After the spep 5 we can be able to see in the last lines.
installation directory location