{%extends "base/page.html"%}
{%block title%}Linux downloads (Ubuntu){%endblock%}
{%block contents%}

<h1>Linux downloads (Ubuntu)</h1>
<p>
PostgreSQL is available in all Ubuntu versions by default. However,
Ubuntu "snapshots" a specific version of PostgreSQL that is then
supported throughout the lifetime of that Ubuntu version. Other
versions of PostgreSQL are available through the PostgreSQL apt
repository, as well as through a <i>PPA</i> (Personal
Package Archive - the Ubuntu standard for addon repositories)
repository.
</p>
<p>
Should packages not be available for your distribution, or there are
issues with your package manager, there are graphical installers available.
</p>
<p>
Finally, most Linux systems make it easy to build from source.
</p>

<h2>Included in distribution</h2>
<p>
Ubuntu includes PostgreSQL by default. To install PostgreSQL on
Ubuntu, use the <i>apt-get</i> (or other apt-driving) command:
</p>
<code>
apt-get install postgresql-9.3
</code>
<p>
The repository contains many different packages including third party
addons. The most command and important packages are (substitute the
version number as required):
</p>
<ul>
 <li>postgresql-client-9.3 - client libraries and client binaries</li>
 <li>postgresql-9.3 - core database server</li>
 <li>postgresql-contrib-9.3 - additional supplied modules</li>
 <li>libpq-dev - libraries and headers for C language frontend development</li>
 <li>postgresql-server-dev-9.3 - libraries and headers for C language backend development</li>
 <li>pgadmin3 - pgAdmin III graphical administration utility</li>
</ul>

<script type="text/javascript">
 <!--
 function updateSeries(select) {
  var deb = document.getElementById('series-deb');
  deb.innerHTML = select.value;
 }
 -->
</script>

<h2>PostgreSQL Apt Repository</h2>
<p>
If the version included in your version of Ubuntu is not the one you want,
you can use the PostgreSQL Apt Repository. This repository will integrate
with your normal systems and patch management, and provide automatic
updates for all supported versions of PostgreSQL throughout the support
<a href="/support/versioning/">lifetime</a> of PostgreSQL.
</p>
<p>
The PostgreSQL apt repository supports LTS versions of Ubuntu, 10.04 and
12.04, on amd64 and i386 architectures. While not fully supported,
the packages often work on non-LTS versions as well, by using the closest
LTS version available.
</p>
<p>
To use the apt repository, follow these steps:
</p>
<ul>
 <li>
  <select id="field.series" name="field.series" onchange='updateSeries(this);'>
   <option selected="selected" value="YOUR_UBUNTU_VERSION_HERE">Choose your Ubuntu version</option>
   <option value="precise">Precise (12.04)</option>
   <option value="lucid">Lucid (10.04)</option>
  </select>
 </li>
 <li>Create the file <i>/etc/apt/sources.list.d/pgdg.list</i>, and add a line
 for the repository
 <code>deb http://apt.postgresql.org/pub/repos/apt/ <span id="series-deb">YOUR_UBUNTU_VERSION_HERE</span>-pgdg main</code>
 </li>
 <li>Import the repository signing key, and update the package lists
   <code>
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \<br/>
&nbsp;&nbsp;sudo apt-key add -<br/>
sudo apt-get update
   </code>
 </li>
</ul>
<p>
For more information about the apt repository, including answers to frequent
questions, please see the apt page on
<a href="http://wiki.postgresql.org/wiki/Apt">the wiki</a>.
</p>

<h2>Ubuntu PPA</h2>
<p>
Other versions of PostgreSQL than the standard one for a specific
Ubuntu version are available in the
<a href="https://launchpad.net/~pitti/+archive/postgresql">PostgreSQL
backports PPA</a> repository. To enable this repository, run the
command:
</p>
<p>
<code>
sudo add-apt-repository ppa:pitti/postgresql
</code>
</p>
<p>
Once this is done, you can proceed to install and update packages the
same way as the ones included in the distribution.
</p>

{%include "pages/download/linux/linux_openscg.inc" %}

{%include "pages/download/linux/linux_oneclick.inc" %}

{%include "pages/download/linux/linux_source.inc" %}
{%endblock%}
