$sudo apt-get update
$sudo apt-get upgrade
#参数YOUR_UBUNTU_VERSION_HERE为 xenial(16.04)/bionic(18.04)/trusty(14.04)
$sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ YOUR_UBUNTU_VERSION_HERE-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
$sudo apt-get install wget ca-certificates
$wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$sudo apt-get update
$sudo apt-get upgrade
$sudo apt-get install postgresql-10
$psql --version #查看版本
$psql -U postgres -d postgres #访问PostgreSQL,安装默认用户名postgres,默认数据库postgres
#安装pgadmin4
$sudo apt-get install pgadmin4 #postgresql10安装完毕之后进行安装
$pgadmin4 #打开pgadmin4
#pgadmin4利用系统上的浏览器显示pgadmin,'add new server'填写正确地址、用户名、密码,就能连接成功
相关链接:
https://www.postgresql.org/download/linux/ubuntu/
ubuntu安装postgresql10以及pgadmin4
最新推荐文章于 2025-05-29 20:00:00 发布
本文介绍如何在Ubuntu系统中安装PostgreSQL数据库及其管理工具pgAdmin4,包括更新软件包列表、添加PostgreSQL源、安装所需依赖以及安装并配置PostgreSQL和pgAdmin4的过程。
1396

被折叠的 条评论
为什么被折叠?



