<p><code>nix-build</code>! :-)</p>
<p>Specifically, this line in the linked docs:</p>
<pre><code>nix-build -A cardano-db-sync -o db-sync-node
</code></pre>

CC BY-SA 4.0
2021-09-14T16:25:54.320Z
2021-09-14T16:25:54.320Z
sorki
<p>Nix as suggest by @sorki is one solution.</p>
<p>Another is to install the development versions of the libraries:</p>
<pre><code>sudo apt install pkg-config libpq-dev
</code></pre>

CC BY-SA 4.0
2022-08-12T06:19:45.987Z
2022-08-12T06:19:45.987Z
Erik de Castro Lopo
<p>The ones I found seems to be out of date.
<a href="https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/building-running.md" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/building-running.md</a></p>
<pre><code>Warning: Requested index-state 2021-07-02T00:00:00Z is newer than
    'hackage.haskell.org'! Falling back to older state (2021-07-01T22:06:28Z).
    Resolving dependencies...
    cabal: Could not resolve dependencies:
    [__0] trying: Win32-network-0.1.0.0 (user goal)
    [__1] trying: base-4.14.2.0/installed-4.14.2.0 (dependency of Win32-network)
    [__2] trying: byron-spec-chain-0.1.0.0 (user goal)
    [__3] trying: microlens-th-0.4.3.10 (dependency of byron-spec-chain)
    [__4] trying: template-haskell-2.16.0.0/installed-2.16.0.0 (dependency of
    microlens-th)
    [__5] trying: pretty-1.1.3.6/installed-1.1.3.6 (dependency of
    template-haskell)
    [__6] trying: hedgehog-1.0.5 (dependency of byron-spec-chain)
    [__7] trying: time-1.9.3/installed-1.9.3 (dependency of hedgehog)
    [__8] trying: text-1.2.4.1/installed-1.2.4.1 (dependency of hedgehog)
    [__9] trying: cardano-api-1.29.0 (user goal)
    [_10] trying: scientific-0.3.7.0 (dependency of cardano-api)
    [_11] trying: aeson-1.5.6.0 (dependency of cardano-api)
    [_12] trying: cardano-db-11.0.0 (user goal)
    [_13] trying: postgresql-simple-0.6.4 (dependency of cardano-db)
    [_14] trying: postgresql-libpq-0.9.4.3 (dependency of postgresql-simple)
    [_15] rejecting: postgresql-libpq:-use-pkg-config (constraint from config
    file, command line flag, or user target requires opposite flag selection)
    [_15] rejecting: postgresql-libpq:+use-pkg-config (conflict: pkg-config
    package libpq&gt;=9.3, not found in the pkg-config database)
    [_15] fail (backjumping, conflict set: postgresql-libpq,
    postgresql-libpq:use-pkg-config)
    After searching the rest of the dependency tree exhaustively, these were the
    goals I've had most trouble fulfilling: postgresql-simple, base,
    postgresql-libpq, aeson, text, time, postgresql-libpq:use-pkg-config,
    scientific, cardano-db, cardano-api, hedgehog, pretty, template-haskell,
    byron-spec-chain, microlens-th, Win32-network
    Try running with --minimize-conflict-set to improve the error message.
</code></pre>

CC BY-SA 4.0
2024-01-15T19:27:31.897Z
It looks like you are missing the `libpq-dev` package.
Erik de Castro Lopo
<cardano-db-sync>
cardano-db-sync build instructions?
# cardano-db-sync build instructions?

(Asked by: username_0 on 2021-09-14)

The ones I found seems to be out of date.
https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/building-running.md
Warning: Requested index-state 2021-07-02T00:00:00Z is newer than
    'hackage.haskell.org'! Falling back to older state (2021-07-01T22:06:28Z).
    Resolving dependencies...
    cabal: Could not resolve dependencies:
    [__0] trying: Win32-network-0.1.0.0 (user goal)
    [__1] trying: base-4.14.2.0/installed-4.14.2.0 (dependency of Win32-network)
    [__2] trying: byron-spec-chain-0.1.0.0 (user goal)
    [__3] trying: microlens-th-0.4.3.10 (dependency of byron-spec-chain)
    [__4] trying: template-haskell-2.16.0.0/installed-2.16.0.0 (dependency of
    microlens-th)
    [__5] trying: pretty-1.1.3.6/installed-1.1.3.6 (dependency of
    template-haskell)
    [__6] trying: hedgehog-1.0.5 (dependency of byron-spec-chain)
    [__7] trying: time-1.9.3/installed-1.9.3 (dependency of hedgehog)
    [__8] trying: text-1.2.4.1/installed-1.2.4.1 (dependency of hedgehog)
    [__9] trying: cardano-api-1.29.0 (user goal)
    [_10] trying: scientific-0.3.7.0 (dependency of cardano-api)
    [_11] trying: aeson-1.5.6.0 (dependency of cardano-api)
    [_12] trying: cardano-db-11.0.0 (user goal)
    [_13] trying: postgresql-simple-0.6.4 (dependency of cardano-db)
    [_14] trying: postgresql-libpq-0.9.4.3 (dependency of postgresql-simple)
    [_15] rejecting: postgresql-libpq:-use-pkg-config (constraint from config
    file, command line flag, or user target requires opposite flag selection)
    [_15] rejecting: postgresql-libpq:+use-pkg-config (conflict: pkg-config
    package libpq>=9.3, not found in the pkg-config database)
    [_15] fail (backjumping, conflict set: postgresql-libpq,
    postgresql-libpq:use-pkg-config)
    After searching the rest of the dependency tree exhaustively, these were the
    goals I've had most trouble fulfilling: postgresql-simple, base,
    postgresql-libpq, aeson, text, time, postgresql-libpq:use-pkg-config,
    scientific, cardano-db, cardano-api, hedgehog, pretty, template-haskell,
    byron-spec-chain, microlens-th, Win32-network
    Try running with --minimize-conflict-set to improve the error message.

**Tags:** cardano-db-sync
> **Comments:**
> **username_1**: It looks like you are missing the `libpq-dev` package.  

---

## 2 answers

### Answer by username_2 on 2021-09-14. Score: 1

nix-build! :-)
Specifically, this line in the linked docs:
nix-build -A cardano-db-sync -o db-sync-node


---

### Answer by username_1 on 2022-08-12. Score: 0

Nix as suggest by @sorki is one solution.
Another is to install the development versions of the libraries:
sudo apt install pkg-config libpq-dev


---

