public
Last active

Steam installer for Debian

  • Download Gist
steam_bootstrap.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
#!/bin/bash
#
# Steam installer for Debian wheezy (32- and 64-bit)
#
# Place into empty directory and run.
#
 
download() {
local url="$1"
local filename="$(basename "$url")"
 
if [ ! -f "$filename" ]; then
wget -c "$url" -O "$filename.part"
mv "$filename.part" "$filename"
fi
}
 
package() {
local url="$1"
local target="$2"
 
download "$url"
 
mkdir -p "$target"
ar p "$(basename "$url")" data.tar.gz | tar xz -C "$target"
}
 
set -e
 
package http://media.steampowered.com/client/installer/steam.deb "${PWD}/tree"
 
STEAMPACKAGE="steam"
STEAMCONFIG="${HOME}/.steam"
STEAMDATALINK="${STEAMCONFIG}/${STEAMCONFIG}"
STEAMBOOTSTRAP="steam.sh"
LAUNCHSTEAMDIR="$(readlink -eq "${STEAMDATALINK}" || echo)"
LAUNCHSTEAMPLATFORM="ubuntu12_32"
LAUNCHSTEAMBOOTSTRAPFILE="${PWD}/tree/usr/lib/steam/bootstraplinux_${LAUNCHSTEAMPLATFORM}.tar.xz"
STEAM_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
CLASSICSTEAMDIR="$HOME/Steam"
DEFAULTSTEAMDIR="$STEAM_DATA_HOME/Steam"
 
STEAMDIR="${DEFAULTSTEAMDIR}"
 
if [ ! -d "$STEAMCONFIG" ]; then
mkdir "$STEAMCONFIG"
fi
 
echo "Setting up Steam content in $STEAMDIR"
 
mkdir -p "${STEAMDIR}"
tar xJf "${LAUNCHSTEAMBOOTSTRAPFILE}" -C "${STEAMDIR}"
 
cat > "${STEAMDIR}/steam_on_debian.sh" <<EOF
#!/bin/sh
STEAMDIR="\$(readlink -f "\$(dirname "\$0")")"
if [ -z "\${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH="\${STEAMDIR}/compat_libraries/lib/i386-linux-gnu"
else
LD_LIBRARY_PATH="\${STEAMDIR}/compat_libraries/lib/i386-linux-gnu:\${LD_LIBRARY_PATH}"
fi
 
export LD_LIBRARY_PATH
 
exec "\${STEAMDIR}/steam.sh" "\$@"
EOF
 
chmod +x "${STEAMDIR}/steam_on_debian.sh"
 
echo "Installing Ubuntu packages"
 
mkdir -p "${STEAMDIR}/compat_libraries"
package http://security.ubuntu.com/ubuntu/pool/main/e/eglibc/libc6_2.15-0ubuntu10.2_i386.deb "${STEAMDIR}/compat_libraries"
 
echo "Installing desktop files"
mkdir -p "${STEAM_DATA_HOME}/applications"
sed "s!/usr/bin/steam!${STEAMDIR}/steam_on_debian.sh!" tree/usr/share/applications/steam.desktop > "${STEAM_DATA_HOME}/applications/steam.desktop"
cp -R tree/usr/share/icons "${STEAM_DATA_HOME}"
 
echo "Adding Steam to PATH"
MAGIC_LINE="[[ -f \"${STEAMDIR}/setup_debian_environment.sh\" ]] && source \"${STEAMDIR}/setup_debian_environment.sh\""
 
cat > "${STEAMDIR}/setup_debian_environment.sh" <<EOF
if ! which steam > /dev/null 2>&1; then
PATH="${STEAMDIR}/debian_bin:${PATH}"
export PATH
fi
EOF
 
mkdir -p "${STEAMDIR}/debian_bin"
 
cat > "${STEAMDIR}/debian_bin/steam" <<EOF
#!/bin/sh
exec "${STEAMDIR}/steam_on_debian.sh" "$@"
EOF
 
chmod +x "${STEAMDIR}/debian_bin/steam"
 
if ! grep -qxF "${MAGIC_LINE}" "${HOME}/.bashrc"; then
echo "$MAGIC_LINE" >> "${HOME}/.bashrc"
 
echo
echo "Steam was added to your profile. Please relogin or source ~/.bashrc."
echo
fi
 
echo "To uninstall:"
echo "rm -rf ${STEAM_DIR}"
echo "rm -f everything steamish from ${STEAM_DATA_HOME}/applications"
echo "remove ${MAGIC_LINE} from ${HOME}/.bashrc"

Please could you specify the needed dependecies?

Thank you!

Using a bang character in the sed expression makes it unnecessarily hard to copy'n'paste the script into a shell. Thanks, though.

Thanks a lot, exactly what I was looking for !

well it installed ok, then I started steam it started the update, then I get a Fatal Error: Failed to lead steamui.so

→ steam
Running Steam on debian 7.0
STEAM_RUNTIME is enabled automatically on debian
Installing breakpad exception handler for appid(steam)/version(1359765526_client)
Installing breakpad exception handler for appid(steam)/version(1359765526_client)

Line 108, wouldn't "${STEAMDIR}" instead of "${STEAM_DIR}" be neat? :D

Thank you very much for this, good sir! I can confirm that it's working on Wheezy.
One small problem I've noticed is that the script does not add a newline character before MAGIC_LINE in .bashrc which is a problem if you don't have an empty line at its end.

Dependencies are: apt-get install libgl1-mesa-glx:i386 \
libgl1-mesa-dri:i386 libcurl3-gnutls:i386 libogg0:i386 \
libpixman-1-0:i386 libsdl1.2debian:i386 libtheora0:i386 \
libvorbis0a:i386 libvorbisenc2:i386 libvorbisfile3:i386 \
libasound2:i386 libc6:i386 libcairo2:i386 libcups2:i386 \
libdbus-1-3:i386 libfontconfig1:i386 libfreetype6:i386 \
libgcc1:i386 libgcrypt11:i386 libgdk-pixbuf2.0-0:i386 \
libglib2.0-0:i386 libgtk2.0-0:i386 libnspr4:i386 \
libnss3:i386 libopenal1:i386 libpango1.0-0:i386 \
libpng12-0:i386 libpulse0:i386 libstdc++6:i386 \
libx11-6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 \
libxrandr2:i386 libxrender1:i386 zlib1g:i386

From http://steamcommunity.com/app/221410/discussions/1/846939071205530634/

With latest steam, i'm getting following error:

Couldn't start bootstrap and couldn't reinstall from /usr/lib/steam/bootstraplinux_ubuntu12_32.tar.xz. Please contact technical support.

Works great, thanks! :+1:

Worked like a charm, plus a learned a couple of new bash tricks, thanks!

Getting this:

Couldn't start bootstrap and couldn't reinstall from /usr/lib/steam/bootstraplinux_ubuntu12_32.tar.xz. Please contact technical support.

Worked great for me, one issue though:

on line 85:

    PATH="${STEAMDIR}/debian_bin:${PATH}"

The ${PATH} in that string expands to your PATH at the time steam_bootstrap.sh was run. This means that if you later try to add a directory to your path (in your .profile or .bashrc or whatever), it gets clobbered by this line. It'd be nicer if this line was instead:

    PATH="${STEAMDER}/debian_bin:\$PATH"

which will expand to the users PATH at the time the setup_debian_environment.sh script is sourced, rather than when steam was first installed, preventing this issue

Thanks.

Brilliant, thanks a lot for this!

Debian is now packaging Steam for testing and unstable: http://packages.qa.debian.org/s/steam.html

If, after running this and sourcing .bashrc, running 'steam' you get this error:

Error: You are missing the following 32-bit libraries, and Steam may not run:
libGL.so.1

Setup multiarch (as root)
# dpkg --add-architecture i386

Install mesa-glx for 32 bits (as root)
# apt-get install libgl1-mesa-glx:i386

Most probably libGL.so.1 is at /usr/lib/mesa-diverted/i386-linux-gnu/ now, so LD_LIBRARY_PATH that before running steam

$ LD_LIBRARY_PATH=/usr/lib/mesa-diverted/i386-linux-gnu/ steam

Cheers,

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.