首页 > 数据库 >Ubuntu postgresql

Ubuntu postgresql

时间:2023-04-24 23:47:22浏览次数:39  
标签:postgresql repository get sudo apt install Ubuntu

Ubuntu


# Create the file repository configuration: sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' # Import the repository signing key: wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - # Update the package lists: sudo apt-get update # Install the latest version of PostgreSQL. # If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql': sudo apt-get -y install postgresql

Debian

# Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

# Update the package lists:
sudo apt-get update

# Install the latest version of PostgreSQL.
# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
sudo apt-get -y install postgresql

For more information about the apt repository, including answers to frequent questions, please see the apt page on the wiki.

Included in distribution

Debian includes PostgreSQL by default. To install PostgreSQL on Debian, use the apt-get (or other apt-driving) command:

  apt-get install postgresql-12

Linux downloads (Red Hat family) 

Copy, paste and run the relevant parts of the setup script:
# Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Install PostgreSQL:
sudo yum install -y postgresql15-server

# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15

标签:postgresql,repository,get,sudo,apt,install,Ubuntu
From: https://www.cnblogs.com/chuangsi/p/17351316.html

相关文章

  • ubuntu22.4.1 部署Postgres12 、PostGIS、TimescaleDB
    参考文章https://www.postgresql.org/download/linux/ubuntu/一、postgres数据库安装#Createthefilerepositoryconfiguration:1.sudosh-c'echo"debhttp://apt.postgresql.org/pub/repos/apt$(lsb_release-cs)-pgdgmain">/etc/apt/sources.list.d/pgdg.l......
  • Ubuntu:PostgreSql安装PostGis、TimeScaleDB插件
    Ubuntu:PostgreSql安装PostGis、TimeScaleDB插件https://docs.timescale.com/self-hosted/latest/install/installation-linux/ Installingself-hostedTimescaleDBonDebian-basedsystemsAtthecommandprompt,asroot,addthePostgreSQLthirdpartyrepository......
  • Ubuntu Vmware虚拟机 没有共享文件夹/mnt/hgfs 解决
    问题现象在Vmware虚拟机设置共享文件夹后,在Ubuntu系统侧应该在/mnt/hgfs目录下可见。然而,有时在重启虚拟机后不存在该文件夹。解决方法在终端中执行以下代码,需要root权限。sudoapt-getinstallopen-vm-toolssudomkdir/mnt/hgfssudo/usr/bin/vmhgfs-fuse.host://mnt/h......
  • ubuntu - k3s安装失败出现unable to find suitable network address.error
    系统时ubuntu18原因:离线安装k3s需要手动设定ip的网关使用iproute 查看是否出现default via  xxxx.xxxx.x.xdev ens33xxxxx内容。 如果没有出现说明没有默认网关。 方式1:临时生效使用命令:iprouteadddefaultvia192.168.1.1devens33  方式2......
  • Ubuntu系统python连接hive遇到的一些问题
    1.第一个问题,sasl这个库安装不上,报缺少sasl.h的问题(#include<sasl/sasl.h>)解决方法:sudoapt-getinstall-ylibsasl2-devgccpython-dev2.第二个问题,连接的时候报CouldnotstartSASL:b‘Errorinsasl_client_start(-4)SASL(-4)解决办法:sudoaptinstalllibsasl2-mod......
  • ubuntu16.04个性化配置
    前言记录一下个人配置,方便后续参考正文配置用户sudo免密权限只建议在个人测试环境这么配置,否则最好root还是需要用密码确认一下sudosuecho"你的用户名ALL=(ALL:ALL)NOPASSWD:ALL">>/etc/sudoersroot用户下,指令自动补全sudosuaptupdateaptinstall......
  • PostgreSQL 性能优化之 - 大锁与long sql/xact的蝴蝶效应
    PostgreSQL性能优化之-大锁与longsql/xact的蝴蝶效应来自:阿里云数据库 2016-03-16 6554举报简介:在使用数据库时,某些特定的因素结合在一起,就可能引发蝴蝶效应。导致数据库性能的急剧下降。本文要讲的是和以下几个因素有关的:因素1PG的锁排队机制,即使没有获得锁,只要在锁......
  • 批量更新Postgresql的序列
    序列(sequence)是PostgreSQL中的一种对象,用于生成自动递增的唯一标识符。通常,序列会与表的自增主键一起使用,以确保每个新插入的行都有一个唯一的标识符。在某些情况下,可能需要更新序列的值:从另一个数据库中导入数据,自增列的值也从原来的数据中导入。导入的过程中,目标数据库的序列......
  • Ubuntu 中查看防火墙的状态
    在Ubuntu中查看防火墙的状态,可以使用ufw命令。ufw是UncomplicatedFirewall的缩写,是Ubuntu默认的防火墙管理工具。如果您想要查看防火墙的状态,可以使用以下命令:sudoufwstatus该命令将显示防火墙的状态,如果防火墙已经开启,则会显示如下信息:Status:activeTo......
  • 7 Best Practice Tips for PostgreSQL Bulk Data Loading
    7BestPracticeTipsforPostgreSQLBulkDataLoading  February19,2023Sometimes,PostgreSQLdatabasesneedtoimportlargequantitiesofdatainasingleoraminimalnumberofsteps.Thisiscommonlyknownasbulkdataimportwherethedatas......