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

<h1>Linux downloads (Debian)</h1>
<p>
PostgreSQL is available in all Debian versions by default. However, the
stable versions of Debians "snapshot" a specific version of PostgreSQL
that is then supported throughout the lifetime of that Debian version.
The PostgreSQL project also maintains an apt repository with all supported
of PostgreSQL available.
</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>
Debian includes PostgreSQL by default. To install PostgreSQL on
Debian, 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 Debian 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 the currently supported stable
versions of debian, squeeze (6.x) and wheezy (7.x), on amd64 and i386
architectures.
</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_DEBIAN_VERSION_HERE">Choose your Debian version</option>
   <option value="wheezy">Wheezy (7.x)</option>
   <option value="squeeze">Squeeze (6.x)</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_DEBIAN_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>Debian backports</h2>
<p>
Newer versions of PostgreSQL for older versions of Debians are available
in <a href="http://backports.debian.org/">Debian backports</a>. For
information on how to enable and use the backports repository, please
see the
<a href="http://backports-master.debian.org/Instructions/">backports instructions</a> page at Debian.
</p>
<p>
Once backports is enabled, you can install PostgreSQL the same way as with
the builtin repositories.
</p>

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

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