Linux Mint 20.x Ubuntu-based / 无法安装 pgadmin4

Linux Mint 20.x Ubuntu-based / Can't install pgadmin4

我已经安装了postgres,好的。 但是我试图安装 pgadmin4 大约 2 个小时,但我做不到。我在 Internet 上尝试了很多指南,他们只是得到了相同的结果:

Package 'pgadmin4' has no installation candidate

我正在使用这个存储库:

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

输出:

Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'

所以,我必须输入 [arch=amd64],对吗? 它应该看起来像这样? deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main

好的,i386 错误不会出现在 apt 更新中。但后来我尝试 apt install pgadmin4

sudo apt install pgadmin4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package pgadmin4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'pgadmin4' has no installation candidate***

看起来像个笑话,我该如何解决这种情况?

为了更清楚。从这个页面:

https://www.pgadmin.org/download/pgadmin-4-apt/

有关于如何设置 Apt 存储库的说明。请参阅下面我的修改版本:

#
# Setup the repository
#

# Install the public key for the repository (if not done previously):
sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add

# Create the repository configuration file:
# SEE MODIFICATION BELOW
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'

#
# Install pgAdmin
#

# Install for both desktop and web modes:
sudo apt install pgadmin4

# Install for desktop mode only:
sudo apt install pgadmin4-desktop

# Install for web mode only: 
sudo apt install pgadmin4-web 

# Configure the webserver, if you installed pgadmin4-web:
sudo /usr/pgadmin4/bin/setup-web.sh

截至 2021/10/08,我发现新的包裹位置可能已更改为:
https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal/dists/pgadmin4/main/

下载 pgadmin4-server 和 pgadmin4-desktop,然后就可以开始了