Skip to content

Commit 445dddb

Browse files
dgibbs64LinuxGSM
andauthored
fix(steamcmd): add libtinfo.so.5 symlink fix for readline warning (#4899)
* fix(steamcmd): add libtinfo.so.5 symlink fix for readline warning 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. * fix(steamcmd): address Copilot review feedback on libtinfo symlink fix - Iterate over all candidate steamcmd dirs (HOME/.steam/steamcmd, steamcmddir, HOME/.local/share/Steam/steamcmd) matching the pattern used for steamclient.so fixes elsewhere in the module - Replace '! -f && ! -L' guard with '! -e' so broken/dangling symlinks are also repaired rather than silently skipped - Add mkdir -p before ln in case the directory does not exist yet - Capture exitcode=$? after ln so fn_fix_msg_end reports failures --------- Co-authored-by: LinuxGSM <dev@linuxgsm.com>
1 parent 9a61c0f commit 445dddb

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

lgsm/modules/fix_steamcmd.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,31 @@ if [ ! -f "${steamclientsdk32}" ]; then
113113
fn_fix_msg_end
114114
fi
115115

116+
# Helps fix: WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5.
117+
# On distros that ship libtinfo.so.6 (e.g. Ubuntu 22.04+, Debian 12+) but not
118+
# libtinfo.so.5, SteamCMD prints this warning and loses readline support.
119+
# Creating a symlink from .so.5 -> .so.6 resolves the warning without root.
120+
for libtinfo32dir in "${HOME}/.steam/steamcmd" "${steamcmddir}" "${HOME}/.local/share/Steam/steamcmd"; do
121+
if [ -d "${libtinfo32dir}" ]; then
122+
libtinfo32so="${libtinfo32dir}/libtinfo.so.5"
123+
# Also repair broken symlinks (! -e catches missing target, -L catches dangling link)
124+
if [ ! -e "${libtinfo32so}" ]; then
125+
# Find the .so.6 in the system 32-bit lib paths
126+
for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do
127+
if [ -f "${libtinfo32so6}" ]; then
128+
fixname="libtinfo.so.5 32-bit symlink"
129+
fn_fix_msg_start
130+
mkdir -p "${libtinfo32dir}"
131+
ln -sf "${libtinfo32so6}" "${libtinfo32so}"
132+
exitcode=$?
133+
fn_fix_msg_end
134+
break
135+
fi
136+
done
137+
fi
138+
fi
139+
done
140+
116141
# steamclient.so fixes
117142
if [ "${shortname}" == "bo" ]; then
118143
fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86"

0 commit comments

Comments
 (0)