在 Ubuntu 19.10 中安装 postgers 12 时出错

在 Ubuntu 19.10 中安装 postgers 12 时出错

我正在 Ubuntu 12 系统上安装 Postgres 12,在尝试运行许多不同的命令时出现错误:

sudo apt -y install postgresql-12
sudo apt  install postgresql-12

这是我的错误输出:

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-11 : Depends: libicu60 (>= 60.1-1~) but it is not installable
E: Unable to correct problems, you have held broken packages.

答案1

/etc/apt/sources.list.d/pgdg文件中,更改bioniceoan

使用:

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

代替:

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

答案2

步骤 1:按下ctrl alt t打开terminal

第 2 步:运行命令

sudo apt clean

步骤 3:更新软件包列表

sudo apt update

步骤 4:删除所有文件/var/lib/apt/lists/partial(如果存在)

sudo rm /var/lib/apt/lists/partial/*

步骤5:更新软件包列表,安装依赖项并安装PostgreSQL

sudo apt update
sudo apt install libicu60 
sudo apt install postgresql-12

相关内容