
Ubuntu Desktop 22.04に、PostgreSQLのクライアント(psql)をインストールします。
記事の目次
インストールする環境を確認する!
psqlをインストールする環境を確認します。
$ hostnamectl
Static hostname: dpc001p1.loc.lab4ict.com
Pretty hostname: dpc001p1
Icon name: computer-desktop
Chassis: desktop
Machine ID: c46d7551318b4a728792dc09d416eb2b
Boot ID: 1c9540f13fa94a8ca922a731560fd9b0
Operating System: Ubuntu 22.04.2 LTS
Kernel: Linux 5.19.0-41-generic
Architecture: x86-64
Hardware Vendor: BIOSTAR Group
Hardware Model: TB250-BTC
Ubuntu標準のリポジトリからpsqlをインストールする!
Ubuntu標準のリポジトリからpsqlをインストールします。
$ sudo apt install -y postgresql-client Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libpq5 postgresql-client-14 postgresql-client-common ...
psqlのバージョンを確認する!
インストールしたpsqlのバージョンを確認します。
$ psql --version psql (PostgreSQL) 14.7 (Ubuntu 14.7-0ubuntu0.22.04.1)
PostgreSQLのサーバに接続する!
PostgreSQLのサーバにネットワーク経由で接続してみます。
$ psql -U postgres -h vmsrdb11 -d postgres Password for user postgres: psql (14.7 (Ubuntu 14.7-0ubuntu0.22.04.1), server 13.10) Type "help" for help. postgres=# \q
おわりに
Ubuntu Desktop 22.04では、標準リポジトリからpsqlをインストールすることができます。
参考情報
関連記事
参考書籍(Amazon)
