Postgresql 无法在Ubuntu 19.04上安装Posgresql

Postgresql 无法在Ubuntu 19.04上安装Posgresql,postgresql,ubuntu,Postgresql,Ubuntu,键入sudo apt get install postgresql-11时出错: 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 m

键入
sudo apt get install postgresql-11
时出错:

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-11 : Depends: postgresql-client-11
                 Depends: libicu55 (>= 55.1-1~) but it is not installable
                 Depends: libpq5 (>= 9.3~) but it is not going to be installed
                 Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not installable
                 Recommends: sysstat but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我如何解决这个错误并最终在我的ubuntu上安装Postgres

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

试着运行那个命令,让我知道你看到了什么。显然,postgres需要一些您尚未安装的软件包来解决未满足的依赖项错误,只需添加最新的PostgreSQL apt存储库即可

$ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
$ wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
然后只需启动更新命令

$ sudo apt-get update
之后,在您的情况下安装postgresql-11

$ sudo apt-get install postgresql-11

它不起作用<代码>以下软件包有未满足的依赖项:postgresql:Dependes:postgresql-11,但它不会被安装postgresql contrib:Dependes:postgresql-contrib-11 E:无法纠正问题,您持有的软件包已损坏。我无法在ubuntu 19上安装任何postgres 9/10/11-第一个答案有帮助。我只需要将apt存储库添加到Ubuntu19。