![デフォルトの PostgreSQL バージョンで pgaudit をインストールできませんでした](https://rvso.com/image/1604290/%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%81%AE%20PostgreSQL%20%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E3%81%A7%20pgaudit%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93%E3%81%A7%E3%81%97%E3%81%9F.png)
Discourse がデフォルトで提供する postgresql にインストールしようとするとpgaudit
、次のような失敗メッセージが表示されました。
<Error Messages>
root@07f8d9674261:/pgaudit# make check USE_PGXS=1
Makefile:16: /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk'. Stop.
root@07f8d9674261:/pgaudit# cd pgaudit/
理由がわかりますか? この問題はどのように解決できますか?
答え1
これは、サーバー開発パッケージがインストールされていないためです。たとえば、Debian/Ubuntuでは、ここで不足しているMakefileは、postgresql-server-dev-11パッケージ。
apt install postgresql-server-dev-11
インストールするには、root として実行します。
$ dpkg -S pgxs.mk
postgresql-server-dev-11: /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk
$ apt show postgresql-server-dev-11
Package: postgresql-server-dev-11
Version: 11.5-1.pgdg18.04+1
Priority: optional
Section: libdevel
Source: postgresql-11
Maintainer: Debian PostgreSQL Maintainers <[email protected]>
Installed-Size: 5 190 kB
Depends: clang-6.0, libpq-dev (>= 11~~), llvm-6.0-dev, postgresql-common (>= 142~), libc6 (>= 2.14)
Breaks: postgresql-server-dev-all (<< 181~)
Homepage: http://www.postgresql.org/
Download-Size: 933 kB
APT-Manual-Installed: yes
APT-Sources: http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 Packages
Description: development files for PostgreSQL 11 server-side programming
Header files for compiling SSI code to link into PostgreSQL's backend; for
example, for C functions to be called from SQL.
.
This package also contains the Makefiles necessary for building add-on
modules of PostgreSQL, which would otherwise have to be built in the
PostgreSQL source-code tree.
.
PostgreSQL is an object-relational SQL database management system.