13

I want to try new PostgreSQL and follow this instruction. But installation fails:

$ sudo apt install postgresql-client-13
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-client-13 : Depends: libpq5 (>= 13~beta2) but 12.3-1.pgdg18.04+1 is to be installed
E: Unable to correct problems, you have held broken packages.

I also tried this instruction to resolve unmet dependencies

What did I wrong and how to install psql 13?

UPD
Content of my sources.list.d:

kes@kes-X751SA /etc/apt/sources.list.d $ cat pgdg.list 
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main

kes@kes-X751SA /etc/apt/sources.list.d $ cat pgdg-testing.list 
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg-testing main 13

Also:

$ sudo apt-cache policy postgresql-13
postgresql-13:
  Installed: (none)
  Candidate: 13~beta2-1.pgdg18.04+1
  Version table:
     13~beta2-1.pgdg18.04+1 100
        100 http://apt.postgresql.org/pub/repos/apt bionic-pgdg-testing/13 amd64 Packages
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
  • 3
    Thank you for using the Beta release. That's an important contribution. This must be a packaging error, and you should report it to the pgsql-pkg-debian [mailing list](https://www.postgresql.org/list/). – Laurenz Albe Jul 15 '20 at 10:18
  • 1
    There are special instructions for installing beta releases. Did you follow the steps listed at https://wiki.postgresql.org/wiki/Apt/FAQ#I_want_to_try_the_beta_version_of_the_next_PostgreSQL_release ? What is the contents of your file /etc/apt/sources.list.d/pgdg.list ? – jjanes Jul 15 '20 at 19:01
  • @jjanes: updated – Eugen Konkov Jul 15 '20 at 20:01
  • 1
    In my hands on ubuntu, the `13` must be added to pgdg.list. I think that pgdg-testing.list is for something else, installing the daily builds, not the betas. – jjanes Jul 16 '20 at 15:48

3 Answers3

14

Had the same problem.
in /etc/apt/sources.list.d/pgdg.list where you have

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

change it to

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

then run

sudo apt update

and then you can do

sudo apt install postgresql-13 postgresql-client-13

that worked on my machine.

Just FYI:

WARNING: The data format may change between beta releases. Be prepared to pg_dump the database contents before you upgrade the package to a newer beta or to a final release. Check the release notes before upgrading.

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
  • 1
    What is `focal` means? – Eugen Konkov Aug 07 '20 at 09:55
  • 4
    @Eugen Konkov: Focal Fossa is the codename for Ubuntu v20.04. Focal means "standing in the focus" and fossa is a frett-cat, a Madagascar endemic species of a predator. – Stefan Steiger Aug 07 '20 at 10:02
  • @Eugen Konkov: Just add the 13 to whatever you have there. – Stefan Steiger Aug 07 '20 at 10:09
  • That works. Thank you. One problem: Grafical `Update manager` shows me psql-13. After `update`. When I click 'Install updates' version 12 were installed =(. After that 13version is disappeared. But when I install 13 version from console I get desired result: `psql (PostgreSQL) 13beta2` – Eugen Konkov Aug 07 '20 at 11:34
  • @Eugen Konkov: Sounds odd and like a bug. As long as it works from command-line, good enough - if it doesn't get removed afterwards. – Stefan Steiger Aug 07 '20 at 12:24
  • @EugenKonkov: That's because Postgres 13 is currently still beta. The latest release version is currently Postgres 12.4. See: https://www.postgresql.org/support/versioning/ – Erwin Brandstetter Aug 24 '20 at 15:54
  • @Erwin Brandstetter: You're saying it's not a bug - it's a feature ? ;) – Stefan Steiger Aug 25 '20 at 08:39
5

try aptitude instead of apt-get

sudo apt-get install aptitude

sudo aptitude install <package-name>

https://askubuntu.com/a/1056378/1087086

Muhammed Moussa
  • 4,589
  • 33
  • 27
-1

Finally at my docker container I do next commands:

RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install llvm5.0-devel
RUN yum -y install centos-release-scl-rh
RUN yum -y install llvm-toolset-7-clang
#RUN rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm --replacepkgs
#RUN yum-config-manager --enable pgdg13-updates-testing
RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum -y install postgresql13 postgresql13-devel

Commented out lines were for case before 13.1 was released

Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158