fix(steamcmd): add libtinfo.so.5 symlink fix for readline warning#4899
fix(steamcmd): add libtinfo.so.5 symlink fix for readline warning#4899
Conversation
On distros shipping libtinfo.so.6 but not libtinfo.so.5 (Ubuntu 22.04+, Debian 12+), SteamCMD prints: WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5. Please install (lib32tinfo5 / ncurses-libs.i686 / equivalent) to enable readline. lib32tinfo5 does not exist on Ubuntu 24.04. Creating a user-space symlink inside the steamcmd directory resolves the warning without requiring root or a missing package.
d0ca2c5 to
c20b4fa
Compare
There was a problem hiding this comment.
Pull request overview
Adds a SteamCMD runtime fix for modern distros missing libtinfo.so.5, and introduces TF2 Classified (tf2c) server support which relies on downloading a base appid into a separate support directory.
Changes:
- Add a user-space
libtinfo.so.5 -> libtinfo.so.6symlink workaround infix_steamcmd.sh. - Add
baseappiddownload support in the SteamCMD download flow (download base app intosupportdirbeforeappidintoserverfiles). - Register new
tf2cserver (server list entry + default config + config install handling).
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lgsm/modules/install_config.sh | Adds config discovery/installation handling for tf2c. |
| lgsm/modules/fix_steamcmd.sh | Creates a libtinfo.so.5 symlink to suppress SteamCMD readline warnings on newer distros. |
| lgsm/modules/core_dl.sh | Implements baseappid download (to supportdir) before downloading appid. |
| lgsm/data/serverlist.csv | Registers tf2c in the supported server list. |
| lgsm/config-default/config-lgsm/tf2cserver/_default.cfg | Adds default LinuxGSM config for the new tf2cserver. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fn_fix_msg_start | ||
| ln -sf "${libtinfo32so6}" "${libtinfo32so}" |
There was a problem hiding this comment.
The symlink creation can fail if ${HOME}/.steam/steamcmd does not exist yet (fresh install / before SteamCMD has run). Consider mkdir -p "${libtinfo32dir}" before ln, and capture exitcode=$? after ln so fn_fix_msg_end reports failures correctly.
| fn_fix_msg_start | |
| ln -sf "${libtinfo32so6}" "${libtinfo32so}" | |
| fn_fix_msg_start | |
| if [ ! -d "${libtinfo32dir}" ]; then | |
| mkdir -p "${libtinfo32dir}" | |
| fi | |
| ln -sf "${libtinfo32so6}" "${libtinfo32so}" | |
| exitcode=$? |
| # Creating a symlink from .so.5 -> .so.6 resolves the warning without root. | ||
| libtinfo32dir="${HOME}/.steam/steamcmd" | ||
| libtinfo32so="${libtinfo32dir}/libtinfo.so.5" | ||
| if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then |
There was a problem hiding this comment.
The guard if [ ! -f ... ] && [ ! -L ... ] skips the fix when libtinfo.so.5 exists as a broken symlink (-L true but target missing). Using an existence check like ! -e (or explicitly handling -L + ! -e) would let the script repair broken links and still avoid overwriting valid files.
| if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then | |
| if [ ! -e "${libtinfo32so}" ]; then |
| libtinfo32dir="${HOME}/.steam/steamcmd" | ||
| libtinfo32so="${libtinfo32dir}/libtinfo.so.5" | ||
| if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then | ||
| # Find the .so.6 in the system 32-bit lib paths | ||
| for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do | ||
| if [ -f "${libtinfo32so6}" ]; then | ||
| fixname="libtinfo.so.5 32-bit symlink" | ||
| fn_fix_msg_start | ||
| ln -sf "${libtinfo32so6}" "${libtinfo32so}" | ||
| fn_fix_msg_end | ||
| break | ||
| fi | ||
| done | ||
| fi |
There was a problem hiding this comment.
This new libtinfo fix hard-codes ${HOME}/.steam/steamcmd, but elsewhere in this module SteamCMD artifacts are searched in multiple locations (e.g. ${steamcmddir} and ${HOME}/.local/share/Steam/steamcmd). To ensure the warning is actually resolved in all supported setups, consider applying the symlink fix to the active SteamCMD directory (or iterating through the same candidate directories used for steamclient.so).
| libtinfo32dir="${HOME}/.steam/steamcmd" | |
| libtinfo32so="${libtinfo32dir}/libtinfo.so.5" | |
| if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then | |
| # Find the .so.6 in the system 32-bit lib paths | |
| for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do | |
| if [ -f "${libtinfo32so6}" ]; then | |
| fixname="libtinfo.so.5 32-bit symlink" | |
| fn_fix_msg_start | |
| ln -sf "${libtinfo32so6}" "${libtinfo32so}" | |
| fn_fix_msg_end | |
| break | |
| fi | |
| done | |
| fi | |
| for libtinfo32dir in "${HOME}/.steam/steamcmd" "${steamcmddir}" "${HOME}/.local/share/Steam/steamcmd"; do | |
| if [ -d "${libtinfo32dir}" ]; then | |
| libtinfo32so="${libtinfo32dir}/libtinfo.so.5" | |
| if [ ! -f "${libtinfo32so}" ] && [ ! -L "${libtinfo32so}" ]; then | |
| # Find the .so.6 in the system 32-bit lib paths | |
| for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do | |
| if [ -f "${libtinfo32so6}" ]; then | |
| fixname="libtinfo.so.5 32-bit symlink" | |
| fn_fix_msg_start | |
| ln -sf "${libtinfo32so6}" "${libtinfo32so}" | |
| fn_fix_msg_end | |
| break | |
| fi | |
| done | |
| fi | |
| fi | |
| done |
8d80501 to
fdb8625
Compare
Description
On distros that ship
libtinfo.so.6but notlibtinfo.so.5(Ubuntu 22.04+, Debian 12+), SteamCMD prints the following warning at every run:lib32tinfo5does not exist on Ubuntu 22.04+ / Debian 12+ — the package was removed when ncurses transitioned tolibtinfo6. This means there is no apt package to install to resolve the warning on modern distros.Fix
In
fix_steamcmd.sh, create a user-space symlink~/.steam/steamcmd/libtinfo.so.5 -> /lib/i386-linux-gnu/libtinfo.so.6(or equivalent path) when the.so.5file is absent. This requires no root access and resolves the warning for all SteamCMD-based game servers.Testing
Tested on Ubuntu 24.04 LTS — warning no longer appears after the symlink is created.