Linux Mint 20.x 基于 Ubuntu / 无法安装 pgadmin4

问题描述 投票:0回答:2

我已经安装了postgres,好吧。 但我尝试安装 pgadmin4 大约 2 小时,但就是做不到。我在互联网上尝试了很多指南,但他们都得到相同的结果:

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 update 中出现。但后来我尝试

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***

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

pgadmin linux-mint
2个回答
28
投票

(更新至2023 ubuntu-22.04LTS) 为了说得更清楚。从这个页面:

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/jammy 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

0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.