我正在使用命令
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
但我得到了这个
Err:2 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release
404 Not Found [IP: 87.238.57.227 443]
Hit:3 https://community-packages.deepin.com/printer eagle InRelease
Hit:4 https://home-store-img.uniontech.com/appstore deepin InRelease
Reading package lists... Done
E: The repository 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
所以我无法安装pgadmin
使用深度linux 20.2.3
我正在使用 Linux mint,问题已使用以下命令修复。
$ sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
$ 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'
$ sudo apt update
然后,如果你想要桌面
$ sudo apt install pgadmin4-desktop
或网页版:
$ sudo apt install pgadmin4-web
$ sudo /usr/pgadmin4/bin/setup-web.sh
# apt-get install curl ca-certificates gnupg
# curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
#vim /etc/apt/sources.list.d/pgdg.list
####### ADD
#deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
# apt-get update
# apt-get install pgadmin4 pgadmin4-apache2
现在应该已成功安装。
对于 Ubuntu 22.10 和其他抱怨 apt-key 被弃用的版本,请使用以下命令:
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
请注意,FTP 链接中使用的是“jammy”。您可以浏览其他版本并选择与您的 Ubuntu 安装版本相匹配的版本
sudo apt install pgadmin4
这将安装网络版和桌面版。
问题是
lsb_release -cs
没有返回Deepin linux的代号,而是返回n/a
。
尝试使用 dpkg --status tzdata|grep Provides|cut -f2 -d'-'
检索代号。
如果您想要像您发布的那样的oneliner,这里有:
sudo sh -c 'curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add && echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(dpkg --status tzdata|grep Provides|cut -f2 -d'-') pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
我在尝试将 pgadmin4 升级到版本 6 时遇到了此错误。我认为我的系统上的证书有问题,解决方案是更新 ca 证书,如果未安装,您可能应该安装它,但这可能非常它不太可能没有安装,因为它应该已经在那里,但无论哪种方式都只需运行命令:
sudo apt install ca-certificates
我在 Kali GNU/Linux Rolling 上遇到了同样的挑战,我设法通过将
$(lsb_release -cs)
更改为 bookworm
来修复它,并且能够安装并运行 pgAdmin4,而不会出现错误 Unable to connect to pgadmin4 server
因此,对于 Kali GNU/Linux Rolling 用户,只需按照 pgAdmin4 页面上的步骤进行操作,或者单击此链接即可前往https://www.pgadmin.org/download/pgadmin-4-apt/,并且如果您到达第二个命令,只需将
$(lsb_release -cs)
更改为 bookworm
并继续其余的
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
我在 Debian 11 上遇到了同样的问题,但是在探索选项时我找到了这个答案在此处输入链接描述并通过安装 lsb-release 解决了问题
这对我有用
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
本地服务器可能不会出现在 pgadmin 的服务器下拉列表中,因此按照此视频中的步骤即可解决问题 https://www.youtube.com/watch?v=jhG2L4OWRY8