Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install the specific version of postgres?

I need to install a postgres 9.6.6 on Ubuntu 14.04, but the command

apt-get install postgresql-9.6

installes 9.6.7.

How can I install 9.6.6?

An output of command

apt-cache policy postgresql-9.6

is

postgresql-9.6:
  Installed: 9.6.7-1.pgdg14.04+1
  Candidate: 9.6.7-1.pgdg14.04+1
  Version table:
 *** 9.6.7-1.pgdg14.04+1 0
        500 http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg/main amd64 Packages
        100 /var/lib/dpkg/status
like image 432
dice2011 Avatar asked Feb 19 '18 14:02

dice2011


Video Answer


1 Answers

You can install a specific version using the PostgreSQL Development Group maintained repo.

For Ubuntu 18.04

  • Create the file /etc/apt/sources.list.d/pgdg.list and add this line for the repository:

deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main

  • 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 -
sudo apt-get update

After this, you can now do: sudo apt-get install postgresql-10 or adapt it for your desired version. See more here

like image 93
Seun Matt Avatar answered Oct 18 '22 10:10

Seun Matt