# Tip for install\_kdb.sh curl install

**URL:** <https://forum.kx.com/t/tip-for-install-kdb-sh-curl-install/15479>\
**Category:** Community Support\
**Tags:** kdb-x\
**Created:** [May 8, 2026, 8:14am UTC](https://forum.kx.com/t/tip-for-install-kdb-sh-curl-install/15479 "2026-05-08T08:14:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lz4\_8fs3](https://avatars.discourse-cdn.com/v4/letter/l/ecd19e/32.png) [@lz4\_8fs3](https://forum.kx.com/u/lz4_8fs3)\
**Post date:** [May 8, 2026, 8:14am UTC](https://forum.kx.com/t/tip-for-install-kdb-sh-curl-install/15479/1 "2026-05-08T08:14:47Z")

</div>

So, if you end up running the curl plus install\_kdb.sh command that is given on the website, you will find that modules don't download, or download sporadically, depending on your connection. This is annoying. So, here's a tip:

**Platform:** Linux (tested on Manjaro x86\_64)  
**Symptom:** Module downloads (AI, kurl, objstor, parquet, REST, dashboards) time out during installation with a message like:

```auto
-------- Downloading AI module --------
Fetching the latest stable version
From: https://portal.dl.kx.com/assets/raw/kdb-x/modules/ai/~latest~/l64-ai.zip
-=O=# # # #
curl: (28) Connection timed out after 300737 milliseconds
Warning: Failed to download AI module. Continuing without AI module

```

* * *

## What's happening

The installer's `download_file()` function calls curl without a `--max-time` flag. When the KX download server responds with a `307` redirect to the versioned URL (e.g. `.../ai/1.0.0/l64-ai.zip`), curl occasionally stalls on the redirected connection. Without a timeout, it just hangs until the OS-level TCP timeout fires — which on most Linux systems is around 300 seconds. It then fails rather than retrying.

The main KDB-X binary download works fine because it uses a different, authenticated code path. The module downloads all go through this unprotected `download_file()` helper.

You can confirm the files are actually accessible by curling them manually:

bash

```auto
curl -L --max-time 60 "https://portal.dl.kx.com/assets/raw/kdb-x/modules/ai/1.0.0/l64-ai.zip" -o /tmp/test.zip

```

If that succeeds, your network is fine — it's the installer that needs fixing.

* * *

## The fix

Download the installer script from the KX Developer Centre as normal, then apply this one-line patch before running it:

bash

```auto
sed -i 's/curl --fail --progress-bar -Lo/curl --fail --progress-bar --max-time 120 --retry 3 --retry-delay 5 -Lo/' install_kdb.sh
sed -i 's/curl --fail -Lo/curl --fail --max-time 120 --retry 3 --retry-delay 5 -Lo/' install_kdb.sh

```

Then run the patched installer as normal:

bash

```auto
bash install_kdb.sh --b64lic <your_license_key>

```

### What the patch does

It modifies the `download_file()` function (around line 198) from:

bash

```auto
download_file() {
    local url="$1"
    local output_file="$2"

    if [-t 1]; then
        curl --fail --progress-bar -Lo "$output_file" "$url"
    else
        curl --fail -Lo "$output_file" "$url"
    fi

    return $?
}

```

To:

bash

```auto
download_file() {
    local url="$1"
    local output_file="$2"

    if [-t 1]; then
        curl --fail --progress-bar --max-time 120 --retry 3 --retry-delay 5 -Lo "$output_file" "$url"
    else
        curl --fail --max-time 120 --retry 3 --retry-delay 5 -Lo "$output_file" "$url"
    fi

    return $?
}

```

The flags added:

- `--max-time 120` — give up after 2 minutes rather than hanging indefinitely

- `--retry 3` — automatically retry up to 3 times on failure

- `--retry-delay 5` — wait 5 seconds between retries

* * *

## Already ran the installer and modules are missing?

If you've already installed and just want the modules, you can download them manually and extract into the right place:

bash

```auto
# AI module (replace with whichever modules you need)
curl -L --max-time 120 "https://portal.dl.kx.com/assets/raw/kdb-x/modules/ai/~latest~/l64-ai.zip" -o /tmp/l64-ai.zip
unzip /tmp/l64-ai.zip -d ~/.kx/

```

The URL pattern for all modules is:

```auto
https://portal.dl.kx.com/assets/raw/kdb-x/modules/<name>/~latest~/l64-<name>.zip

```

Known module names: `ai`, `kurl`, `objstor`, `pq` (parquet), `rest-server`, `dashboards`.

* * *

_Hopefully KX adds retry logic to the official installer soon. In the meantime this workaround gets you a complete install._

---

<div class="post-metadata">

**Author:** ![lkerr2](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/lkerr2/32/57_2.png) [@lkerr2](https://forum.kx.com/u/lkerr2)\
**Post date:** [May 13, 2026, 10:11am UTC](https://forum.kx.com/t/tip-for-install-kdb-sh-curl-install/15479/2 "2026-05-13T10:11:29Z")

</div>

Thank you for sharing @lz4_8fs3 !
