Linux 下載(Ubuntu)PostgreSQL
PostgreSQL 默認(rèn)支持所有 Ubuntu 版本。然而,Ubuntu “快照”特定版本的PostgreSQL,隨后在整個(gè)范圍內(nèi)得到支持 該Ubuntu版本的生命周期。 PostgreSQL 項(xiàng)目維護(hù)一個(gè)支持 Apt 的倉(cāng)庫(kù) PostgreSQL的可用性。
包含在發(fā)行中
Ubuntu 默認(rèn)包含 PostgreSQL。要在Ubuntu上安裝PostgreSQL, 使用(或其他APT駕駛)命令:apt
apt install postgresql
PostgreSQL Apt 倉(cāng)庫(kù)
如果你版本的Ubuntu不是你想要的, 你可以使用 PostgreSQL Apt Repository。該倉(cāng)庫(kù)將實(shí)現(xiàn)集成 通過(guò)常規(guī)系統(tǒng)和補(bǔ)丁管理,自動(dòng)提供 在PostgreSQL支持生命周期內(nèi),所有支持版本的更新。
PostgreSQL Apt 倉(cāng)庫(kù)支持當(dāng)前版本的 Ubuntu:
任務(wù)(25.10,非LTS)
Plucky(25.04,非LTS)
高貴(24.04,LTS)
jammy(22.04,LTS)
關(guān)于以下架構(gòu):
AMD64
arm64(僅限LTS版本)
ppc64el(僅限LTS版本)
自動(dòng)化存儲(chǔ)庫(kù)配置:
sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
要手動(dòng)配置Apt倉(cāng)庫(kù),請(qǐng)按照以下步驟作:
# Import the repository signing key:
sudo apt install curl ca-certificates
sudo install -d /usr/share/postgresql-common/pgdg
sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail http://m.lncdfzh.com.cn/media/keys/ACCC4CF8.asc
# Create the repository configuration file:
. /etc/os-release
sudo sh -c "echo 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] http://m.lncdfzh.com.cn/pub/repos/apt $VERSION_CODENAME-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
# Update the package lists:
sudo apt update
安裝PostgreSQL:(用你想要的版本替換“18”)
sudo apt install postgresql-18
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)