8

我想尝试新的 PostgreSQL 并按照说明进行操作。但安装失败:

$ 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.

我也试过这个指令来解决unmet依赖关系

我做错了什么以及如何安装psql13?

我的UPD
内容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

还:

$ 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
4

3 回答 3

8

有同样的问题。
/etc/apt/sources.list.d/pgdg.list你有的地方

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

将其更改为

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

然后运行

sudo apt update

然后你可以做

sudo apt install postgresql-13 postgresql-client-13

在我的机器上工作。

仅供参考

警告:数据格式可能会在 beta 版本之间发生变化。在将软件包升级到更新的 beta 版或最终版本之前,请准备好 pg_dump 数据库内容。升级前检查发行说明。

于 2020-08-07T09:51:19.997 回答
4

尝试aptitude代替apt-get

sudo apt-get install aptitude

sudo aptitude install <package-name>

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

于 2021-03-14T19:18:16.467 回答
0

最后在我的 docker 容器中,我执行下一个命令:

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

注释掉的行13.1是发布前的案例

于 2020-12-22T08:54:56.090 回答