7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu 20.04にpostgresql-client-13をインストール (Unable to locate package postgresql-client-13の対処方法)

Posted at

環境

  • AWS
  • Ubuntu 20.04

概要

  • 以下のコマンドで、postgresql-client-12はインストールできるが
sudo apt install postgresql-client-12
  • 以下のコマンドで、postgresql-client-13はインストールできない
sudo apt install postgresql-client-13

E: Unable to locate package postgresql-client-13

インストール手順

準備

  • 参考にしたサイトでは
    • updateとupgradeを行う
    • 再起動を行う
    • vim、wget、bash-completionをインストール
  • とあるが省略可能
sudo apt update
sudo apt -y upgrade

sudo reboot
sudo apt -y install vim bash-completion wget

PostgreSQL 13 repositoryをUbuntuのシステムに追加

  • aptにキーを追加(PostgreSQL repository用のPGP PUBLIC KEYを追加)
    • PostgreSQL repositoryを参照するために必要な手順と捉えておけばよさそう
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  • Ubuntuが参照するリストにPostgreSQL repositoryを追加
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |sudo tee  /etc/apt/sources.list.d/pgdg.list

インストール

  • リポジトリの参照先を変更したのでupdateする
sudo apt update
  • クライアントのインストール
sudo apt install postgresql-client-13
  • サーバのインストール
sudo apt install postgresql-13 

確認

psql --version
dpkg --get-selections | grep postgresql

参考にしたサイト

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?