就算是我这种门外汉也能理解,用强力的解决方法给 `Amazon Linux` 安装 `postgresql10` 包
我是俺。
因为关于Amazon Linux 2的信息很多,所以我会记下来。Amazon Linux仍然是一款活跃的操作系统。
假设出现了一个 Amazon Linux 上必须安装 PostgreSQL 10 版本才能正常运行的问题。
如果不让进来就会死亡
pg_dump -U saikyouser -h pgdb10.local saikoudb > saikou.sql
パスワード:
pg_dump: サーババージョン: 10.7、pg_dump バージョン: 9.6.XX
pg_dump: サーババージョンの不整合のため処理を中断しています
解决方案
创建repo文件
我将创建一个名为“力こそパワー.repo”的文件。
- /etc/yum.repos.d/pgdg10.repo
[pgdg10]
name=PostgreSQL 10 - Amazon Linux AMI 201X.0X - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-10
[pgdg10-source]
name=PostgreSQL 10 Amazon Linux AMI 201X.0X - $basearch - Source
failovermethod=priority
baseurl=https://download.postgresql.org/pub/repos/yum/srpms/10/redhat/rhel-6-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-10
安装postgresql10软件包。
[root@iikunitukurokamakurabakufu.com yum.repos.d]# yum install postgresql10 --enablerepo=pgdg10
読み込んだプラグイン:priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5 kB 00:00:00
pgdg10 | 3.7 kB 00:00:00
(1/2): pgdg10/x86_64/group_gz | 245 B 00:00:01
(2/2): pgdg10/x86_64/primary_db | 222 kB 00:00:02
45 packages excluded due to repository priority protections
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ postgresql10.x86_64 0:10.9-1PGDG.rhel6 を インストール
--> 依存性の処理をしています: postgresql10-libs(x86-64) = 10.9-1PGDG.rhel6 のパッケージ: postgresql10-10.9-1PGDG.rhel6.x86_64
--> 依存性の処理をしています: libpq.so.5()(64bit) のパッケージ: postgresql10-10.9-1PGDG.rhel6.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ postgresql10-libs.x86_64 0:10.9-1PGDG.rhel6 を インストール
--> 依存性解決を終了しました。
依存性を解決しました
===============================================================================================================
Package アーキテクチャー バージョン リポジトリー 容量
===============================================================================================================
インストール中:
postgresql10 x86_64 10.9-1PGDG.rhel6 pgdg10 1.6 M
依存性関連でのインストールをします:
postgresql10-libs x86_64 10.9-1PGDG.rhel6 pgdg10 326 k
トランザクションの要約
===============================================================================================================
インストール 1 パッケージ (+1 個の依存関係のパッケージ)
総ダウンロード容量: 1.9 M
インストール容量: 9.5 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): postgresql10-libs-10.9-1PGDG.rhel6.x86_64.rpm | 326 kB 00:00:02
(2/2): postgresql10-10.9-1PGDG.rhel6.x86_64.rpm | 1.6 MB 00:00:02
---------------------------------------------------------------------------------------------------------------
合計 759 kB/s | 1.9 MB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : postgresql10-libs-10.9-1PGDG.rhel6.x86_64 1/2
インストール中 : postgresql10-10.9-1PGDG.rhel6.x86_64 2/2
検証中 : postgresql10-10.9-1PGDG.rhel6.x86_64 1/2
検証中 : postgresql10-libs-10.9-1PGDG.rhel6.x86_64 2/2
インストール:
postgresql10.x86_64 0:10.9-1PGDG.rhel6
依存性関連をインストールしました:
postgresql10-libs.x86_64 0:10.9-1PGDG.rhel6
完了しました!