Ubuntu 20.04 Focal
尝试为 postgresql 安装 pgAdmin4。
sudo apt-get install -f pgadmin4
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:
pgadmin4 : Depends: libpython3.7 (>= 3.7.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
我已经安装了libpython3.8,为什么apt无法识别它?
sudo apt-get install libpython3.8
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpython3.8 is already the newest version (3.8.2-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
apt-cache policy pgadmin4
pgadmin4:
Installed: (none)
Candidate: 4.18-1.pgdg19.10+1
Version table:
4.18-1.pgdg19.10+1 500
500 http://apt.postgresql.org/pub/repos/apt eoan-pgdg/main amd64 Packages
答案1
作为解决方法,您可以从源代码安装 pgadmin4,以下是一些详细信息: https://askubuntu.com/a/1231676/1073281
答案2
我发现很多人都遇到了同样的问题(包括我),所以我研究了解决方案并决定使用通过docker的pgadmin4来解决这个问题。我建议您现在使用带有docker的pgadmin4。在终端中按照以下步骤操作:
--install the docker on Ubuntu focal
$ sudo apt install docker.io
--Download the image
$ sudo docker pull dpage/pgadmin4
--Run the image
$ sudo docker run -p 80:80 --name=pgadmin -e "[email protected]" -e "PGADMIN_DEFAULT_PASSWORD=your_password" -d dpage/pgadmin4
--See the container status
$ sudo docker ps -a
打开网络浏览器并使用:http://本地主机
第一次您必须填写 PGADMIN_DEFAULT_EMAIL 中定义的电子邮件和 PGADMIN_DEFAULT_PASSWORD 中定义的密码。
其他时候,将显示 pgAdmin4 仪表板屏幕,您无需再次输入电子邮件和密码。
享受 !