Promouvoir serveur
81 lines 6.4 KiB Markdown Source Rendered Raw Permalink History
---
title: "How to Install the 32-bit Libraries HLDS Needs (lib32, i386)"
excerpt: "HLDS is a 32-bit binary and modern 64-bit Linux ships none of its runtime. Here is the exact i386 package set for Debian, Ubuntu, and RHEL, plus how to diagnose which one is missing."
category: "installation"
tags: "linux, dependencies"
image: ""
read_time: "8 min read"
---
<p>HLDS, ReHLDS, <code>cs.so</code>, Metamod and every AMXX module are 32-bit (i386) ELF objects. A modern 64-bit Linux install has no reason to carry a 32-bit runtime and does not, so the single most common CS 1.6 install failure is a missing i386 library. This guide is the reference for exactly which packages to install and, more usefully, how to work out which one you are actually missing instead of guessing.</p>

<h2>1. The tell-tale error</h2>
<p>The most confusing symptom is this:</p>
<pre>./hlds_linux: No such file or directory</pre>
<p>The file plainly exists — you are staring at it. What is missing is the 32-bit ELF interpreter, <code>/lib/ld-linux.so.2</code>. The kernel cannot find the loader named in the binary's header, and reports that as "No such file or directory". The other family of errors names the library directly:</p>
<pre>error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory</pre>
<p>Both mean the same thing: install the 32-bit runtime.</p>

<h2>2. Enable multiarch (Debian / Ubuntu)</h2>
<pre>sudo dpkg --add-architecture i386
sudo apt update</pre>
<p>Without <code>--add-architecture i386</code>, apt does not even know the <code>:i386</code> packages exist and refuses to install them.</p>

<h2>3. The package set</h2>
<p>On current Debian 12 and Ubuntu 22.04/24.04:</p>
<pre>sudo apt install -y \
  lib32gcc-s1 \
  lib32stdc++6 \
  libc6:i386 \
  libncurses6:i386 \
  libcurl4:i386</pre>
<table>
<thead><tr><th>Package</th><th>Provides</th><th>Symptom if missing</th></tr></thead>
<tbody>
<tr><td><code>libc6:i386</code></td><td>32-bit glibc + <code>ld-linux.so.2</code></td><td><code>No such file or directory</code></td></tr>
<tr><td><code>lib32stdc++6</code></td><td>32-bit libstdc++</td><td><code>libstdc++.so.6: cannot open</code></td></tr>
<tr><td><code>lib32gcc-s1</code></td><td>32-bit libgcc_s</td><td><code>libgcc_s.so.1: cannot open</code></td></tr>
<tr><td><code>libncurses6:i386</code></td><td>console text UI</td><td>console garbled / <code>libncurses.so.6</code> missing</td></tr>
<tr><td><code>libcurl4:i386</code></td><td>HTTP for some AMXX modules/sockets</td><td>module <code>bad load</code></td></tr>
</tbody>
</table>

<h2>4. Older releases use different names</h2>
<p>Package names drifted over the years. If apt says a package has no candidate, try the alternate:</p>
<ul>
<li><code>lib32gcc-s1</code> was <code>lib32gcc1</code> on older Ubuntu/Debian.</li>
<li><code>libncurses6:i386</code> may be <code>libncurses5:i386</code> on older releases; some binaries want <code>libtinfo</code> too.</li>
<li>On some releases the meta-package <code>libc6-i386</code> is the way glibc's 32-bit files are shipped rather than <code>libc6:i386</code>.</li>
</ul>

<h2>5. RHEL / CentOS / Rocky / Alma</h2>
<p>The i686 packages are the equivalent:</p>
<pre>sudo dnf install -y glibc.i686 libstdc++.i686 libgcc.i686 \
  ncurses-libs.i686 libcurl.i686</pre>

<h2>6. Diagnose exactly what is missing</h2>
<p>Do not install packages blindly — ask the binary what it wants. <code>ldd</code> against the 32-bit binary lists every dependency and flags the unresolved ones:</p>
<pre>ldd hlds_linux</pre>
<p>Any line ending in <code>=&gt; not found</code> is a library you are missing; map the <code>.so</code> name back to a package with the table above. Confirm the binary really is 32-bit while you are there:</p>
<pre>file hlds_linux</pre>
<p>It must say <em>ELF 32-bit LSB executable, Intel 80386</em>. If you are debugging a module rather than the engine, point <code>ldd</code> at it:</p>
<pre>ldd cstrike/dlls/cs.so
ldd cstrike/addons/amxmodx/dlls/amxmodx_mm_i386.so</pre>
<p>This is how you catch the case where the engine starts fine but one AMXX module reports <code>bad load</code> — that module has a 32-bit dependency the engine itself did not need.</p>

<h2>Why 32-bit at all, in 2026?</h2>
<p>There is no 64-bit build of the Half-Life engine. HLDS, ReHLDS, ReGameDLL, Metamod and every AMXX module are compiled for i386 and always have been — the whole plugin ecosystem is 32-bit, and a 64-bit rebuild would break binary compatibility with thousands of existing modules. So the answer is not "port it to 64-bit", it is "install the 32-bit runtime". This is why <code>file</code> on any part of the stack must always report <em>Intel 80386</em>; a 64-bit object anywhere in the chain is a mistake, not an upgrade.</p>

<h2>A note on the Steam runtime</h2>
<p>SteamCMD itself is also 32-bit and needs the same <code>libc6:i386</code> loader. If <code>steamcmd.sh</code> fails before it even downloads anything — complaining it cannot find a 32-bit interpreter — it is the identical missing-i386 problem, fixed by the same package set. Once the runtime is in place, both SteamCMD and the game server it installs will run.</p>

<h2>Common errors</h2>
<ul>
<li><strong>Installed the packages, still <code>No such file or directory</code></strong> — you installed the 64-bit versions. Confirm the <code>:i386</code> (or <code>.i686</code>) suffix; the plain package is the wrong architecture.</li>
<li><strong><code>E: Unable to locate package lib32gcc-s1</code></strong> — you skipped <code>dpkg --add-architecture i386</code> and <code>apt update</code>, or you are on a release that names it <code>lib32gcc1</code>.</li>
<li><strong>One module fails, engine is fine</strong> — run <code>ldd</code> on that module; it needs a 32-bit library (often <code>libcurl4:i386</code> for sockets/HTTP modules) the engine does not.</li>
<li><strong>Everything resolves in <code>ldd</code> but it still won't start</strong> — the binary itself is 64-bit or corrupt. Check with <code>file</code>; re-download if it is not <em>Intel 80386</em>.</li>
</ul>

<h2>Verification</h2>
<pre>ldd hlds_linux | grep -i "not found"</pre>
<p>No output means every dependency resolves. Start the server; it should reach a map instead of dying at load. Once the runtime is in place, the rest of the stack — <a href="/tutorials/install-rehlds-on-linux">ReHLDS</a>, <a href="/tutorials/install-regamedll-cs16">ReGameDLL</a>, Metamod and AMXX — all share these same 32-bit libraries, so this is a one-time fix per host.</p>