Apt/FAQ

From PostgreSQL wiki

< Apt(Difference between revisions)
Jump to: navigation, search
(Note on raring/13.04)
(Undo revision 20705 by Wibrt (talk))
Line 56: Line 56:
 
===I want only specific packages from this repository===
 
===I want only specific packages from this repository===
  
Per default, the PGDG repository will have the same "pinning" priority as your Ubuntu repositories. This means your existing PostgreSQL packages will be replaced with versions from this repository, because they have greater version numbers. If you do not want this, you need to configure pinning (see apt_preferences(5) for details).
+
Per default, the PGDG repository will have the same "pinning" priority as your Debian/Ubuntu repositories. This means your existing PostgreSQL packages will be replaced with versions from this repository, because they have greater version numbers. If you do not want this, you need to configure pinning (see apt_preferences(5) for details).
  
 
Create the file '''/etc/apt/preferences.d/pgdg.pref''':
 
Create the file '''/etc/apt/preferences.d/pgdg.pref''':
Line 78: Line 78:
 
       9.1.8-1 0
 
       9.1.8-1 0
 
         500 <nowiki>http://ftp.debian.org/debian/</nowiki> wheezy/main amd64 Packages
 
         500 <nowiki>http://ftp.debian.org/debian/</nowiki> wheezy/main amd64 Packages
 
 
Note about debian wheezy:
 
The default pinning is higher (990) than the default pinning of additional repositories (eg apt.postgresql.org will get 500) if a target-release is set.
 
So the behaviour is bit different then with ubuntu. Let's say you want them to have the same priority this time, then u need to put 990 as pinning priority in the file /etc/apt/preferences.d/pgdg.pref. If u don't want to do this, but still have trouble installing try the '''-t wheezy-pgdg''' option with apt or aptitude.
 
More information about this:
 
http://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_tweaking_candidate_version
 
  
 
===I want libpq5 for version X, but there is only version Y in the repository===
 
===I want libpq5 for version X, but there is only version Y in the repository===

Revision as of 15:08, 12 February 2014

Contents

apt.postgresql.org FAQ

General Questions

What's the difference between the PostgreSQL packages provided by Debian/Ubuntu and by the PGDG apt repository?

Pretty little, actually. The PGDG packages are built from the same source as the Debian packages (Ubuntu is using the same source for the PostgreSQL server packages as well). We try to follow Debian unstable's versions as close as possible, i.e. the packages available here are the same, just rebuilt with a ".pgdg" appended to the version number. We are also using the same postgresql-common infrastructure packages.

Should I use Debian/Ubuntu's packages, or the PGDG packages?

Debian and Ubuntu only ship one PostgreSQL server version per release. For example, there is only PostgreSQL 8.4 in Debian Squeeze/6.0. If that is the version you want, use it. There is no real difference. If you want a different PostgreSQL server version, use the PGDG packages.

Same goes for extension module packages, except that we are updating to new upstream versions earlier (following Debian unstable), while Debian/Ubuntu will only accept patches for critical problems in a released distribution.

What about Debian backports?

[Debian backports] provide newer package versions for released distributions, similar to what the PGDG apt repository does. The scope of the backports archive is strictly limited to testing -> stable, and stable -> oldstable backports, though. The PGDG apt repository provides a broader range of available packages, and Debian version/PostgreSQL version combinations than what would be possible to provide on backports.

Similar to the previous FAQ question, if the package you want is available on backports, there is nothing wrong with using it.

Are these packages ready for production?

As said above, these packages are identical to what Debian/Ubuntu are releasing. So yes, these packages are recommended for production use.

What's pgapt.debian.net?

pgapt.debian.net was the old location of this repository, and it is still kept in sync for its current users. Please update your sources.list to point to apt.postgresql.org. We will shut down pgapt.debian.net at the end of January 2013.

Technical Questions

How do I dist-upgrade?

Just update your sources.list entries, and use your favorite package tool.

When compiling packages for several distributions, we append different suffixes to the package version numbers to make sure, upgrades work. Debian Squeeze packages have ".pgdg60+1" appended, Wheezy packages ".pgdg70+1" and so on; likewise ".pgdg12.4+1" for Ubuntu Precise. (Sid packages have ".pgdg+1", which sorts after all the others in Debian's version number scheme.) This makes sure packages from the old distribution you used will be properly replaced by packages from the new distribution when you do a dist-upgrade.

Where is the "stable" distribution?

We prefer to only use codenames (squeeze, precise, ...) for distribution names. We run a different repository from Debian, so we would never be able to update the stable/oldstable/testing symlinks at the very same time when a new Debian release comes out, and there would be a time window where users would be seeing an inconsistencies. (Also, it is usually better to use codenames in sources.list even for Debian distributions, because then the user decides when it is time for upgrade.)

I am using a non-LTS release of Ubuntu

We chose to support only the LTS (long term support) releases of Ubuntu because otherwise we'd need to support too many distributions in parallel. Generally, you can use the packages from the LTS release that predates your release, i.e. on raring (13.04), you would use precise-pgdg (12.04).

There is a known incompatibility between 12.04 and later releases involving the "logrotate" package. Possible workarounds are:

  • use the logrotate package from precise, or
  • uninstall logrotate.

We are looking into providing a nicer solution for this problem.

I want only specific packages from this repository

Per default, the PGDG repository will have the same "pinning" priority as your Debian/Ubuntu repositories. This means your existing PostgreSQL packages will be replaced with versions from this repository, because they have greater version numbers. If you do not want this, you need to configure pinning (see apt_preferences(5) for details).

Create the file /etc/apt/preferences.d/pgdg.pref:

Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 200

The default priority for repositories is 500, so 200 will lower the PGDG repository priority enough such you don't get packages automatically installed from there, but once you have packages installed, they will keep getting upgraded to newer versions from the PGDG repository.

You can check your setup using the apt-cache policy command to see if "200" shows up in the output:

$ apt-cache policy postgresql-9.1
postgresql-9.1:
  Installed: 9.1.8-1.pgdg70+1
  Candidate: 9.1.8-1.pgdg70+1
  Version table:
 *** 9.1.8-1.pgdg70+1 0
        200 http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg/main amd64 Packages
        100 /var/lib/dpkg/status
     9.1.8-1 0
        500 http://ftp.debian.org/debian/ wheezy/main amd64 Packages

I want libpq5 for version X, but there is only version Y in the repository

libpq5 is compatible with older versions, so there is usually little reason to use a specific version. (psql requires at least the version corresponding to its own version, most other software does not really care.) For that reason, we ship the libpq5 package built from the latest stable PostgreSQL server version in the main archive component.

If you really want to use a different version, the packages are available in separate archive components named after the PostgreSQL major version. Append that version after "main" in your sources.list. For example, if you wanted 9.0's libpq5 on Debian Squeeze, use this:

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

Note that the other libpq5 package will still be visible in the "main" component, so you will need to configure pinning or set that package on hold to prevent apt from trying to upgrade to the newer version.

I want to try the beta version of the next PostgreSQL release

We ship packages for the beta releases, but like in the previous FAQ entry, we have only one version of libpq5 in the main archive component. To use packages of postgresql-9.3, you need to add the 9.3 component to your /etc/apt/sources.list.d/pgdg.list entry, so the 9.3 version of libpq5 will be available for installation:

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

What are the testing distributions?

We have distributions squeeze-pgdg-testing, precise-pgdg-testing, sid-pgdg-testing, ... which receive all updates before they are promoted to the "live" distributions. These are not meant for production use, but you are welcome to use them and help debugging and testing the packages. Please join the mailing list or the IRC channel. The distributions have a lower apt priority by default, you will have to set up pinning (e.g. with priority 500) if you want them to be used automatically.

There are also distributions called *-pgdg-deprected - these are intended to serve as a "morgue" for deprected PostgreSQL versions, and modules for these, but we haven't moved anything there yet.

Can I mirror the repository?

For a full mirror of some or all distributions, we suggest to use debmirror. For mirroring just a subset of packages, reprepro offers the ability to "pull" packages from remote repositories.

Personal tools