在CentOS上安裝pgAdmin時,確保滿足以下依賴項是很重要的。以下是在CentOS 7和CentOS 8上安裝pgAdmin的步驟:
對于CentOS 7:
sudo yum update
sudo yum install epel-release
sudo yum install postgresql-server
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo -u postgres createuser --interactive
sudo -u postgres createdb pgadmin4
sudo yum install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4/web/pgadmin4-4.24.0.tar.gz
sudo tar xvf pgadmin4-4.24.0.tar.gz -C /usr/lib/pgadmin
sudo ln -s /usr/lib/pgadmin/pgadmin4 /usr/local/bin/pgadmin4
pgadmin4
對于CentOS 8:
sudo dnf update
sudo dnf install epel-release
sudo dnf install postgresql-server
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo -u postgres createuser --interactive
sudo -u postgres createdb pgadmin4
sudo dnf install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4/web/pgadmin4-4.24.0.tar.gz
sudo tar xvf pgadmin4-4.24.0.tar.gz -C /usr/lib/pgadmin
sudo ln -s /usr/lib/pgadmin/pgadmin4 /usr/local/bin/pgadmin4
pgadmin4
注意:上述步驟中的版本號(例如4.24.0)可能會隨著時間的推移而發生變化。請訪問pgAdmin官方網站(https://www.pgadmin.org/download/pgadmin-4/)以獲取最新版本。