Linux 下载(Ubuntu)PostgreSQL

2025-12-11 17:48:13 232

PostgreSQL 默认支持所有 Ubuntu 版本。然而,Ubuntu “快照”特定版本的PostgreSQL,随后在整个范围内得到支持 该Ubuntu版本的生命周期。 PostgreSQL 项目维护一个支持 Apt 的仓库 PostgreSQL的可用性。


包含在发行中

Ubuntu 默认包含 PostgreSQL。要在Ubuntu上安装PostgreSQL, 使用(或其他APT驾驶)命令:apt

apt install postgresql


PostgreSQL Apt 仓库

如果你版本的Ubuntu不是你想要的, 你可以使用 PostgreSQL Apt Repository。该仓库将实现集成 通过常规系统和补丁管理,自动提供 在PostgreSQL支持生命周期内,所有支持版本的更新。


PostgreSQL Apt 仓库支持当前版本的 Ubuntu:


任务(25.10,非LTS)

Plucky(25.04,非LTS)

高贵(24.04,LTS)

jammy(22.04,LTS)

关于以下架构:


AMD64

arm64(仅限LTS版本)

ppc64el(仅限LTS版本)

自动化存储库配置:

sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

要手动配置Apt仓库,请按照以下步骤作:


# 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 /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] /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



提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题:
XML 地图