PGAdmin 4 在 postgresql 从 v12 升级到 v13 后不再工作
PGAdmin 4 not working anymore after postgresql Upgrade from v12 to v13
我刚刚将 ubuntu 发行版从 20.10 升级到 21.04。
在此过程中,我的本地 postgres 服务器从 12.x 升级到 13.4
我的本地应用程序仍在运行,但 PGAdmin 将不再启动。这是日志:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "/usr/pgadmin4/venv/bin/python3"
Runtime Config File: "/home/julien/.config/pgadmin/runtime_config.json"
pgAdmin Config File: "/usr/pgadmin4/web/config.py"
Webapp Path: "/usr/pgadmin4/web/pgAdmin4.py"
pgAdmin Command: "/usr/pgadmin4/venv/bin/python3 -s /usr/pgadmin4/web/pgAdmin4.py"
Environment:
- GJS_DEBUG_TOPICS: JS ERROR;JS LOG
- LC_TIME: fr_FR.UTF-8
- USER: julien
- XDG_SESSION_TYPE: wayland
- SHLVL: 0
- HOME: /home/julien
- OLDPWD: /home/julien
- DESKTOP_SESSION: ubuntu
- GIO_LAUNCHED_DESKTOP_FILE: /usr/share/applications/pgadmin4.desktop
- GTK_MODULES: gail:atk-bridge
- GNOME_SHELL_SESSION_MODE: ubuntu
- LC_MONETARY: fr_FR.UTF-8
- MANAGERPID: 2723
- DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
- GIO_LAUNCHED_DESKTOP_FILE_PID: 409396
- WAYLAND_DISPLAY: wayland-0
- LOGNAME: julien
- _: /usr/bin/gnome-session
- rvm_bin_path: /usr/share/rvm/bin
- JOURNAL_STREAM: 8:37688
- XDG_SESSION_CLASS: user
- USERNAME: julien
- GNOME_DESKTOP_SESSION_ID: this-is-deprecated
- PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/share/rvm/bin
- SESSION_MANAGER: local/sunchain:@/tmp/.ICE-unix/2935,unix/sunchain:/tmp/.ICE-unix/2935
- INVOCATION_ID: b0a4bd7f387b4b94b2d1ad6290b4faa6
- LC_ADDRESS: fr_FR.UTF-8
- XDG_RUNTIME_DIR: /run/user/1000
- XDG_MENU_PREFIX: gnome-
- GNOME_SETUP_DISPLAY: :1
- DISPLAY: :0
- LANG: en_US.UTF-8
- LC_TELEPHONE: fr_FR.UTF-8
- XDG_CURRENT_DESKTOP: ubuntu:GNOME
- XDG_SESSION_DESKTOP: ubuntu
- XMODIFIERS: @im=ibus
- XAUTHORITY: /run/user/1000/.mutter-Xwaylandauth.OGNI80
- SSH_AGENT_LAUNCHER: gnome-keyring
- SSH_AUTH_SOCK: /run/user/1000/keyring/ssh
- LC_NAME: fr_FR.UTF-8
- SHELL: /usr/bin/zsh
- QT_ACCESSIBILITY: 1
- GDMSESSION: ubuntu
- rvm_prefix: /usr/share
- LC_MEASUREMENT: fr_FR.UTF-8
- LC_IDENTIFICATION: fr_FR.UTF-8
- rvm_version: 1.29.12 (manual)
- GJS_DEBUG_OUTPUT: stderr
- QT_IM_MODULE: ibus
- PWD: /home/julien
- XDG_DATA_DIRS: /usr/local/share/:/usr/share/:/var/lib/snapd/desktop
- LC_NUMERIC: fr_FR.UTF-8
- LC_PAPER: fr_FR.UTF-8
- rvm_path: /usr/share/rvm
- GDK_BACKEND: x11
- NO_AT_BRIDGE: 1
- PGADMIN_INT_PORT: 34035
- PGADMIN_INT_KEY: dbb4e565-1e23-474d-bd74-c3d8606022cc
- PGADMIN_SERVER_MODE: OFF
--------------------------------------------------------
Failed to launch pgAdmin4. Error:
Error: spawn /usr/pgadmin4/venv/bin/python3 ENOENT
我应该怎么做才能解决它?
在这种情况下,您通常首先尝试卸载并重新安装软件...
我 运行 在 Ubuntu 21.10(顽皮)进入这个,接受的答案没有帮助。回想起来它是正确的,除非你仔细检查你的 apt 源没有搞砸,否则它不会工作,如果你同样搞砸了它们;我认为 pgadmin4 没有完全安装时我的安装路径很无聊,试图安装过去的版本。
假设您安装了 python3.8,问题源于 pgadmin4;如果你不这样做,它就会坏掉。
但这是因为您安装的 pgadmin4 版本与您的 Ubuntu 版本不匹配。
garrett@garrett-external:/etc/apt/sources.list.d$ ls
deadsnakes-ubuntu-ppa-impish.list pgadmin4.list.save pgdg.list.save
pgadmin4.list pgdg.list
##Looking at pgadmin4.list.save , I see I had at least tried to use
# hirsute 's repo:
garrett@garrett-external:/etc/apt/sources.list.d$ cat pgadmin4.list.save
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/hirsute pgadmin4 main
##I'm thinking this is overriding the correct impish repos, so I'll
# try deleting that file, purging the installation and re-installing:
garrett@garrett-external:/etc/apt/sources.list.d$ ls
deadsnakes-ubuntu-ppa-impish.list pgadmin4.list pgadmin4.list.save pgdg.list pgdg.list.save
garrett@garrett-external:/etc/apt/sources.list.d$ sudo rm pgadmin4.list.save
##double check that the pgadmin4 sources are correct...
garrett@garrett-external:/etc/apt/sources.list.d$ ls
deadsnakes-ubuntu-ppa-impish.list pgadmin4.list pgdg.list pgdg.list.save
garrett@garrett-external:/etc/apt/sources.list.d$ cat pgadmin4.list
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main
##^ok definitely the problem...should fix that....
garrett@garrett-external:/etc/apt/sources.list.d$ sudo sed -i 's/focal/impish/g' /etc/apt/sources.list.d/pgadmin4.list
garrett@garrett-external:/etc/apt/sources.list.d$ cat ./pgadmin4.list
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/impish pgadmin4 main
##uninstall pgadmin4
garrett@garrett-external:/etc/apt/sources.list.d$ sudo apt purge pgadmin4
garrett@garrett-external:/etc/apt/sources.list.d$ sudo apt autoremove
##reinstall pgadmin4
garrett@garrett-external:/etc/apt/sources.list.d$ sudo apt update && sudo apt install pgadmin4
And now it works fine
编辑:不要进入下面的兔子洞
解决方法:使用 deadsnakes PPA 和一些临时的 apt 缓存更新技巧手动安装 python3.8
#first add deadsnakes ppa...
$ sudo add-apt-repository ppa:deadsnakes
# Following the gist of https://brennan.io/2021/06/21/deadsnakes-hirsute/ ,
# update the deadsnakes ppa's app repos to look at the past 2 LTS versions
$ sudo vim /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-impish.list
---> change
'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ impish main' to
'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ bionic main' , also add
'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ focal main'
#Add the following rules which blacklist all packages from
# the repos, and then selectively enable Python versions from the correct
# locations. This can be put in any filename within the directory
# /etc/apt/preferences.d/ (I named mine deadsnakes_pref)
Explanation: Prevent installing from deadsnakes repo.
Package: *
Pin: release o=LP-PPA-deadsnakes
Pin-Priority: 1
Explanation: Allow installing python 3.{6,7} from deadsnakes/focal
Package: *python3.6* *python3.7*
Pin: release o=LP-PPA-deadsnakes,n=focal
Pin-Priority: 500
Explanation: Allow installing python 3.8 from deadsnakes/bionic
Package: *python3.8*
Pin: release o=LP-PPA-deadsnakes,n=bionic
Pin-Priority: 500
##temporarily change all your sources to bionic, so the python3.8
#dependencies will be met
$ sudo sed -i 's/impish/bionic/g' /etc/apt/sources.list
## try to update the apt cache and install python3.8 . You'll get yelled
# at for not having the proper key ring:
****************
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
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.
****************
## so following
## https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey
## , I add the key
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
# now this should work
$ sudo apt update && sudo apt install python3.8
#after we're done, don't forget to change back your sources
$ sudo sed -i 's/bionic/impish/g' /etc/apt/sources.list
$ sudo apt update
#And now pgadmin4 should work. If you want to run it from the terminal,
# add this line to your ~/.bash_aliases file:
alias pgadmin4='/usr/pgadmin4/bin/pgadmin4'
sudo apt install python3.8
在 Ubuntu 22.04
帮助了我
我刚刚将 ubuntu 发行版从 20.10 升级到 21.04。 在此过程中,我的本地 postgres 服务器从 12.x 升级到 13.4
我的本地应用程序仍在运行,但 PGAdmin 将不再启动。这是日志:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "/usr/pgadmin4/venv/bin/python3"
Runtime Config File: "/home/julien/.config/pgadmin/runtime_config.json"
pgAdmin Config File: "/usr/pgadmin4/web/config.py"
Webapp Path: "/usr/pgadmin4/web/pgAdmin4.py"
pgAdmin Command: "/usr/pgadmin4/venv/bin/python3 -s /usr/pgadmin4/web/pgAdmin4.py"
Environment:
- GJS_DEBUG_TOPICS: JS ERROR;JS LOG
- LC_TIME: fr_FR.UTF-8
- USER: julien
- XDG_SESSION_TYPE: wayland
- SHLVL: 0
- HOME: /home/julien
- OLDPWD: /home/julien
- DESKTOP_SESSION: ubuntu
- GIO_LAUNCHED_DESKTOP_FILE: /usr/share/applications/pgadmin4.desktop
- GTK_MODULES: gail:atk-bridge
- GNOME_SHELL_SESSION_MODE: ubuntu
- LC_MONETARY: fr_FR.UTF-8
- MANAGERPID: 2723
- DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
- GIO_LAUNCHED_DESKTOP_FILE_PID: 409396
- WAYLAND_DISPLAY: wayland-0
- LOGNAME: julien
- _: /usr/bin/gnome-session
- rvm_bin_path: /usr/share/rvm/bin
- JOURNAL_STREAM: 8:37688
- XDG_SESSION_CLASS: user
- USERNAME: julien
- GNOME_DESKTOP_SESSION_ID: this-is-deprecated
- PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/share/rvm/bin
- SESSION_MANAGER: local/sunchain:@/tmp/.ICE-unix/2935,unix/sunchain:/tmp/.ICE-unix/2935
- INVOCATION_ID: b0a4bd7f387b4b94b2d1ad6290b4faa6
- LC_ADDRESS: fr_FR.UTF-8
- XDG_RUNTIME_DIR: /run/user/1000
- XDG_MENU_PREFIX: gnome-
- GNOME_SETUP_DISPLAY: :1
- DISPLAY: :0
- LANG: en_US.UTF-8
- LC_TELEPHONE: fr_FR.UTF-8
- XDG_CURRENT_DESKTOP: ubuntu:GNOME
- XDG_SESSION_DESKTOP: ubuntu
- XMODIFIERS: @im=ibus
- XAUTHORITY: /run/user/1000/.mutter-Xwaylandauth.OGNI80
- SSH_AGENT_LAUNCHER: gnome-keyring
- SSH_AUTH_SOCK: /run/user/1000/keyring/ssh
- LC_NAME: fr_FR.UTF-8
- SHELL: /usr/bin/zsh
- QT_ACCESSIBILITY: 1
- GDMSESSION: ubuntu
- rvm_prefix: /usr/share
- LC_MEASUREMENT: fr_FR.UTF-8
- LC_IDENTIFICATION: fr_FR.UTF-8
- rvm_version: 1.29.12 (manual)
- GJS_DEBUG_OUTPUT: stderr
- QT_IM_MODULE: ibus
- PWD: /home/julien
- XDG_DATA_DIRS: /usr/local/share/:/usr/share/:/var/lib/snapd/desktop
- LC_NUMERIC: fr_FR.UTF-8
- LC_PAPER: fr_FR.UTF-8
- rvm_path: /usr/share/rvm
- GDK_BACKEND: x11
- NO_AT_BRIDGE: 1
- PGADMIN_INT_PORT: 34035
- PGADMIN_INT_KEY: dbb4e565-1e23-474d-bd74-c3d8606022cc
- PGADMIN_SERVER_MODE: OFF
--------------------------------------------------------
Failed to launch pgAdmin4. Error:
Error: spawn /usr/pgadmin4/venv/bin/python3 ENOENT
我应该怎么做才能解决它?
在这种情况下,您通常首先尝试卸载并重新安装软件...
我 运行 在 Ubuntu 21.10(顽皮)进入这个,接受的答案没有帮助。回想起来它是正确的,除非你仔细检查你的 apt 源没有搞砸,否则它不会工作,如果你同样搞砸了它们;我认为 pgadmin4 没有完全安装时我的安装路径很无聊,试图安装过去的版本。
假设您安装了 python3.8,问题源于 pgadmin4;如果你不这样做,它就会坏掉。
但这是因为您安装的 pgadmin4 版本与您的 Ubuntu 版本不匹配。
garrett@garrett-external:/etc/apt/sources.list.d$ ls
deadsnakes-ubuntu-ppa-impish.list pgadmin4.list.save pgdg.list.save
pgadmin4.list pgdg.list
##Looking at pgadmin4.list.save , I see I had at least tried to use
# hirsute 's repo:
garrett@garrett-external:/etc/apt/sources.list.d$ cat pgadmin4.list.save
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/hirsute pgadmin4 main
##I'm thinking this is overriding the correct impish repos, so I'll
# try deleting that file, purging the installation and re-installing:
garrett@garrett-external:/etc/apt/sources.list.d$ ls
deadsnakes-ubuntu-ppa-impish.list pgadmin4.list pgadmin4.list.save pgdg.list pgdg.list.save
garrett@garrett-external:/etc/apt/sources.list.d$ sudo rm pgadmin4.list.save
##double check that the pgadmin4 sources are correct...
garrett@garrett-external:/etc/apt/sources.list.d$ ls
deadsnakes-ubuntu-ppa-impish.list pgadmin4.list pgdg.list pgdg.list.save
garrett@garrett-external:/etc/apt/sources.list.d$ cat pgadmin4.list
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main
##^ok definitely the problem...should fix that....
garrett@garrett-external:/etc/apt/sources.list.d$ sudo sed -i 's/focal/impish/g' /etc/apt/sources.list.d/pgadmin4.list
garrett@garrett-external:/etc/apt/sources.list.d$ cat ./pgadmin4.list
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/impish pgadmin4 main
##uninstall pgadmin4
garrett@garrett-external:/etc/apt/sources.list.d$ sudo apt purge pgadmin4
garrett@garrett-external:/etc/apt/sources.list.d$ sudo apt autoremove
##reinstall pgadmin4
garrett@garrett-external:/etc/apt/sources.list.d$ sudo apt update && sudo apt install pgadmin4
And now it works fine
编辑:不要进入下面的兔子洞 解决方法:使用 deadsnakes PPA 和一些临时的 apt 缓存更新技巧手动安装 python3.8
#first add deadsnakes ppa...
$ sudo add-apt-repository ppa:deadsnakes
# Following the gist of https://brennan.io/2021/06/21/deadsnakes-hirsute/ ,
# update the deadsnakes ppa's app repos to look at the past 2 LTS versions
$ sudo vim /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-impish.list
---> change
'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ impish main' to
'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ bionic main' , also add
'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/ focal main'
#Add the following rules which blacklist all packages from
# the repos, and then selectively enable Python versions from the correct
# locations. This can be put in any filename within the directory
# /etc/apt/preferences.d/ (I named mine deadsnakes_pref)
Explanation: Prevent installing from deadsnakes repo.
Package: *
Pin: release o=LP-PPA-deadsnakes
Pin-Priority: 1
Explanation: Allow installing python 3.{6,7} from deadsnakes/focal
Package: *python3.6* *python3.7*
Pin: release o=LP-PPA-deadsnakes,n=focal
Pin-Priority: 500
Explanation: Allow installing python 3.8 from deadsnakes/bionic
Package: *python3.8*
Pin: release o=LP-PPA-deadsnakes,n=bionic
Pin-Priority: 500
##temporarily change all your sources to bionic, so the python3.8
#dependencies will be met
$ sudo sed -i 's/impish/bionic/g' /etc/apt/sources.list
## try to update the apt cache and install python3.8 . You'll get yelled
# at for not having the proper key ring:
****************
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
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.
****************
## so following
## https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey
## , I add the key
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
# now this should work
$ sudo apt update && sudo apt install python3.8
#after we're done, don't forget to change back your sources
$ sudo sed -i 's/bionic/impish/g' /etc/apt/sources.list
$ sudo apt update
#And now pgadmin4 should work. If you want to run it from the terminal,
# add this line to your ~/.bash_aliases file:
alias pgadmin4='/usr/pgadmin4/bin/pgadmin4'
sudo apt install python3.8
在 Ubuntu 22.04