Steam

Resources

Steam is a video game digital distribution service by Valve. Steam offers digital rights management (DRM), matchmaking servers, video streaming, and social networking services. It also provides the user with installation and automatic updating of games, and community features such as friends lists and groups, cloud saving, and in-game voice and chat functionality. - Wikipedia, the free encyclopedia

The Steam client is not open source software, therefore each user must accept the Steam Subscriber Agreement before using the software, then typically accept EULAs or Terms of Use agreements for each particular title accessed through the Steam client.

Valve Corporation has collaborated with open source software organizations such as CodeWeavers (Wine)[1] in order to make closed source games possible to run on open source operating systems.

Games[edit | edit source]

Prerequisites[edit | edit source]

Important
Steam is a 32-bit application and requires a multilib profile on amd64. That is, during Gentoo installation, when choosing profiles the no-multilib option was not selected. This prerequisite can be ignored if installing Steam in a chroot.

Kernel[edit | edit source]

Steam expects that /dev/shm, which requires kernel tmpfs support, is mounted prior to being started. /dev/shm should be mounted automatically by OpenRC and systemd during boot, but can also be mounted explicitly via /etc/fstab:

FILE /etc/fstab
# to limit the size add e.g. size=768M to opts (default is 50%)

#<fs>      <mountpoint>    <type>	<opts>		     <dump/pass>
shm        /dev/shm        tmpfs        nodev,nosuid,noexec  0 0

The kernel option CONFIG_COMPAT_32BIT_TIME has to be set, otherwise Steam may fail to start with the error message: “The futex facility returned an unexpected error code.“

Installation[edit | edit source]

Note
Steam officially supports only the most recent version of Ubuntu LTS. Attempting to run Steam on any other Linux distribution may cause various issues. Refer to client and games troubleshooting for details.

The Steam installer downloads and installs the Steam client to the users home directory. This prevents Portage from managing the Steam client updates or the software installed by it. The Steam client is solely responsible for managing software installation and updates.

Important
The instructions throughout this page use the typical Steam installation directory ~/.local/share/Steam.

External repositories[edit | edit source]

The steam-launcher ebuild is available from the steam-overlay repository, which is Gentoo's primary repository for the Steam client and Steam-based games. The steam-overlay repository can be added manually or with repository management tools eselect-repository and layman.

Adding the repository manually[edit | edit source]

Install the required dependencies:

root #emerge --ask --noreplace dev-vcs/git

Install the Steam repository configuration:

root #wget -P /etc/portage/repos.conf/ https://raw.githubusercontent.com/anyc/steam-overlay/master/steam-overlay.conf

Sync the Steam repository:

root #emaint sync --repo steam-overlay
Note
The above only needs to be performed once, since the repository will be auto synced during emerge --sync or emaint sync --auto operations.

eselect-repository[edit | edit source]

Install app-eselect/eselect-repository and dev-vcs/git:

root #emerge --ask --noreplace app-eselect/eselect-repository dev-vcs/git

Add the Steam repository:

root #eselect repository enable steam-overlay

Layman[edit | edit source]

Note
Please refer to the Layman page for comprehensive installation instructions.

Install Layman:

root #emerge --ask --noreplace app-portage/layman

Fetch the Steam repository:

root #layman -f

Display the information about the specified repository:

root #layman -i steam-overlay

Add the Steam repository:

root #layman -a steam-overlay

Emerge[edit | edit source]

Note
Thanks to the Proton runtime built into Steam, 32-bit binaries of most dependencies are included within the Steam installation. Some system dependencies remain however, but Portage should prompt for them. These packages should be added to /etc/portage/package.use/steam with their abi_x86_32 USE flag enabled.

Once the repository has been added install the steam-launcher ebuild:

root #emerge --ask games-util/steam-launcher

Alternatively, install the steam-meta ebuild to pull in all Steam related ebuilds:

root #emerge --ask games-util/steam-meta

Manual[edit | edit source]

Note
Installing Steam manually is not recommend as various fixes are not applied automatically[2]. Please consider installing Steam from an external repository.

Dependencies[edit | edit source]

Note
The following dependencies may be outdated and require verification. Some of the dependencies may be bundled by the Steam runtime, in which case the system libraries will not be used.

Create the following set of required Steam dependencies:

FILE /etc/portage/sets/steam
# mandatory!
dev-libs/glib:2
dev-libs/libgcrypt
dev-libs/nspr
dev-libs/nss
gnome-base/gconf
gnome-extra/zenity
media-libs/alsa-lib
media-libs/fontconfig
media-libs/freetype:2
media-libs/libjpeg-turbo
media-libs/libogg
media-libs/libpng-compat:1.2
media-libs/libsdl
media-libs/libtheora
media-libs/libvorbis
media-libs/openal
net-misc/curl
net-print/cups
sys-apps/dbus
virtual/libusb:1
virtual/opengl
x11-libs/cairo
x11-libs/gdk-pixbuf
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/libXScrnSaver
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/pango
x11-libs/pixman

# optional
media-sound/pulseaudio
net-misc/networkmanager
x11-misc/xdg-user-dirs

And then run:

root #emerge --ask --noreplace @steam
Warning
Do not run emerge --unmerge @steam to remove Steam as it may make the system unusable. Instead use emerge --ask --depclean @steam for this method.

USE flags[edit | edit source]

To enable the required USE flags for Steam dependencies under amd64, add the the following file:

FILE /etc/portage/package.use/steam
app-arch/bzip2 abi_x86_32
dev-db/sqlite abi_x86_32
dev-libs/atk abi_x86_32
dev-libs/expat abi_x86_32
dev-libs/fribidi abi_x86_32
dev-libs/glib abi_x86_32
dev-libs/gmp abi_x86_32
dev-libs/icu abi_x86_32
dev-libs/libcroco abi_x86_32
dev-libs/libffi abi_x86_32
dev-libs/libpcre abi_x86_32
dev-libs/libpthread-stubs abi_x86_32
dev-libs/libtasn1 abi_x86_32
dev-libs/libunistring abi_x86_32
dev-libs/libxml2 abi_x86_32
dev-libs/lzo abi_x86_32
dev-libs/nettle abi_x86_32
dev-libs/nspr abi_x86_32
dev-libs/nss abi_x86_32
dev-libs/openssl abi_x86_32
dev-libs/wayland abi_x86_32
dev-util/pkgconfig abi_x86_32
gnome-base/librsvg abi_x86_32
media-gfx/graphite2 abi_x86_32
media-libs/fontconfig abi_x86_32
media-libs/freetype abi_x86_32
media-libs/harfbuzz abi_x86_32
media-libs/libpng abi_x86_32
media-libs/mesa abi_x86_32
media-libs/openal abi_x86_32
media-libs/tiff abi_x86_32
net-dns/libidn2 abi_x86_32
net-libs/gnutls abi_x86_32
net-misc/curl abi_x86_32
net-nds/openldap abi_x86_32
net-print/cups abi_x86_32
sys-apps/attr abi_x86_32
sys-apps/dbus abi_x86_32
sys-apps/util-linux abi_x86_32
sys-devel/gettext abi_x86_32
sys-devel/llvm abi_x86_32
sys-fs/udev abi_x86_32
sys-libs/binutils-libs abi_x86_32
sys-libs/gpm abi_x86_32
sys-libs/ncurses abi_x86_32
sys-libs/readline abi_x86_32
sys-libs/zlib abi_x86_32
virtual/libffi abi_x86_32
virtual/libiconv abi_x86_32
virtual/libudev abi_x86_32
virtual/pkgconfig abi_x86_32
x11-libs/cairo abi_x86_32
x11-libs/gdk-pixbuf abi_x86_32
x11-libs/gtk+:2 abi_x86_32
x11-libs/libX11 abi_x86_32
x11-libs/libXScrnSaver abi_x86_32
x11-libs/libXau abi_x86_32
x11-libs/libXcomposite abi_x86_32
x11-libs/libXcursor abi_x86_32
x11-libs/libXdamage abi_x86_32
x11-libs/libXdmcp abi_x86_32
x11-libs/libXext abi_x86_32
x11-libs/libXfixes abi_x86_32
x11-libs/libXft abi_x86_32
x11-libs/libXi abi_x86_32
x11-libs/libXinerama abi_x86_32
x11-libs/libXrandr abi_x86_32
x11-libs/libXrender abi_x86_32
x11-libs/libXxf86vm abi_x86_32
x11-libs/libdrm abi_x86_32
x11-libs/libpciaccess abi_x86_32
x11-libs/libxcb abi_x86_32
x11-libs/libxshmfence abi_x86_32
x11-libs/pango abi_x86_32
x11-libs/pixman abi_x86_32
x11-proto/damageproto abi_x86_32
x11-proto/dri2proto abi_x86_32
x11-proto/dri3proto abi_x86_32
x11-proto/fixesproto abi_x86_32
x11-proto/glproto abi_x86_32
x11-proto/inputproto abi_x86_32
x11-proto/kbproto abi_x86_32
x11-proto/presentproto abi_x86_32
x11-proto/xcb-proto abi_x86_32
x11-proto/xextproto abi_x86_32
x11-proto/xf86bigfontproto abi_x86_32
x11-proto/xf86driproto abi_x86_32
x11-proto/xf86vidmodeproto abi_x86_32
x11-proto/xproto abi_x86_32

# If not using systemd add this, otherwise chances are the libudev/udev will
# be pulled as dependencies and eudev removed from your system.
sys-fs/eudev abi_x86_32

Update the system:

root #emerge --ask --changed-use --deep @world
Note
Users may receive an error citing circular dependencies due to gpm and ncurses. If this is the case, add -gpm to sys-libs/ncurses and update the @world set once more.

Default installer[edit | edit source]

Fetch and extract the Steam installer:

user $wget https://repo.steampowered.com/steam/pool/steam/s/steam/steam_1.0.0.66.tar.gz
user $tar -xvzpf steam_1.0.0.66.tar.gz

Run the Steam installer:

user $cd steam
user $./steam
Note
After invoking ./steam a libGL error may appear. See Steam/Client troubleshooting for the resolution.

If the Steam client crashes, try running:

user $./steam -textclient

Running Steam with the -textclient option may be necessary each time the client wants to update.

Install the above Steam installer script:

root #cp steam /usr/local/bin

Steam can be started with:

user $steam

Alternative installer[edit | edit source]

The following installation method is almost identical to the Default installer installation method, except that an alternative Steam installer script is used.

Fetch the Steam installer and extract the required files:

user $wget https://repo.steampowered.com/steam/pool/steam/s/steam/steam_1.0.0.66.tar.gz
user $tar -xvzf steam_1.0.0.66.tar.gz steam/bootstraplinux_ubuntu12_32.tar.xz
user $tar -xvzf steam_1.0.0.66.tar.gz steam/steam.desktop

Fetch and run Julian Ospald's (hasufell) Steam installer script:

user $cd steam
user $wget https://gist.githubusercontent.com/hasufell/d02a93eccbe35be7a803/raw/987ea287dc81a60d2eb5fa1bb188eae0a5f1049f/steam
user $chmod +x steam
user $./steam

If the installer script creates broken symbolic links when run with Dash, run the installer script with Bash instead:

user $bash ./steam

Chroot[edit | edit source]

Steam can be run in a 64-bit multilib chroot on amd64. The major advantage of a chroot is that Steam and its dependencies will be isolated from the root filesystem.

Note
The Steam browser is no longer supported on 32-bit Linux distributions, and is disabled when viewing the Store, Community, or User Profile tabs in the Steam client[3]. Although Steam can be be run in a 32-bit chroot, it is recommend (and necessary for 64-bit games) to use a 64-bit multilib chroot.

Create the chroot directory. If a 32-bit chroot is used, adjust the chroot directory accordingly.

root #mkdir /usr/local/steam64
root #cd /usr/local/steam64

Fetch and extract the stage3 tarball. If a 32-bit chroot is used, download the x86 stage3 tarball instead.

root #wget http://distfiles.gentoo.org/releases/amd64/autobuilds/current-stage3-amd64/stage3-amd64-20191002T214502Z.tar.xz
root #tar xpvf stage3*.tar.xz --xattrs-include='*.*' --numeric-owner

Copy DNS information and ensure it's world-readable:

root #cp -L /etc/resolv.conf etc
root #chmod a+r etc/resolv.conf

Create the ebuild repository directory:

root #mkdir var/db/repos/gentoo
Note
/var/db/repos/gentoo is used as the location for the main ebuild repository. This has been the default for new installations since sys-apps/portage 2.3.64[4]. If this is an old installation or migration to the new location has not taken place, then use the legacy location /usr/portage accordingly. Please be aware that all recent stage tarballs also use the new location.

Mount the necessary filesystems:

root #mount -t proc /proc proc
root #mount -R /sys sys
root #mount -R /dev dev
root #mount -R /run run
root #mount -R /var/db/repos/gentoo var/db/repos/gentoo

Chroot with linux64 and update the environment. If a 32-bit chroot is used, chroot with linux32 instead. The use of linux64 is not required on amd64, and it is only used here for consistency.

root #linux64 chroot .
root #env-update && source /etc/profile
root #export PS1="(chroot) $PS1"

The chroot should now be updated and configured accordingly. It is recommended to at least configure the timezone and enable sound support by installing media-libs/alsa-lib.

Now create the Steam user with the same UID (usually 1000) as the local user. The local UID can be determined by running id -u as the local user, outside of the chroot. Using the same UID will simplify the process of granting access to the X server from inside the chroot.

(chroot) root #useradd -u <UID> -m -G audio,video steam

Install Steam from one of the above installation methods. When complete, exit the chroot:

(chroot) root #exit

Unmount the chroot directories:

root #umount -l proc
root #umount -l sys
root #umount -l dev
root #umount -l run
root #umount -l var/db/repos/gentoo

Install xhost to allow access to the X server from inside the chroot:

root #emerge --ask --noreplace x11-apps/xhost

Logout, and then login. This allows the display manager or xinit to process /etc/X11/xinit/xinitrc.d/00-xhost and automatically grant all local connections to the X server from the local UID. This will not work if the Steam UID is different to that of the local UID. Either set the same UID when creating the Steam user, as was mentioned earlier, or if the Steam user already exists change the Steam UID with usermod -u <UID> steam to match the local UID.

Alternatively, run xhost +local: to allow all local connections to the X server from any local UID. This is a potential security risk as any user could access the X server without authentication. To revoke access run xhost -local:

Next, create the following wrapper script to setup the chroot, substitute to the Steam user, and start Steam. The wrapper script has two user defined variables: chroot_bits and chroot_dir. The chroot_bits variable must be set to 32 for a 32-bit chroot, and 64 for a 64-bit chroot. The chroot_dir variable should be set to the location of the chroot directory.

FILE /usr/local/bin/steam-chroot
#!/bin/sh

# steam chroot bits
chroot_bits="64"

# steam chroot directory
chroot_dir="/usr/local/steam64"

# check if chroot bits is valid
if [ "${chroot_bits}" = "32" ] ; then
  chroot_arch="linux32"
elif [ "${chroot_bits}" = "64" ] ; then
  chroot_arch="linux64"
else
  printf "Invalid chroot bits value '%s'. Permitted values are '32' and '64'.\n" "${chroot_bits}"
  exit 1
fi

# check if the chroot directory exists
if [ ! -d "${chroot_dir}" ] ; then
  printf "The chroot directory '%s' does not exist!\n" "${chroot_dir}"
  exit 1
fi

# mount the chroot directories
mount -v -t proc /proc "${chroot_dir}/proc"
mount -vR /sys "${chroot_dir}/sys"
mount -vR /dev "${chroot_dir}/dev"
mount -vR /run "${chroot_dir}/run"
mount -vR /var/db/repos/gentoo "${chroot_dir}/var/db/repos/gentoo"

# chroot, substitute user, and start steam
"${chroot_arch}" chroot "${chroot_dir}" su -c 'steam' steam

# unmount the chroot directories when steam exits
umount -vl "${chroot_dir}/proc"
umount -vl "${chroot_dir}/sys"
umount -vl "${chroot_dir}/dev"
umount -vl "${chroot_dir}/run"
umount -vl "${chroot_dir}/var/db/repos/gentoo"
Note
The wrapper script bind mounts /run so Steam can connect to D-Bus if it is running on the host. Steam will work even if D-Bus is not installed, but there will be non-fatal errors relating to Steam's bundled dev-libs/libappindicator. Steam also needs D-Bus if the Remember my password option is selected at the Steam login dialog. Refer to client troubleshooting for further details.

Make the wrapper script executable:

root #chmod +x /usr/local/bin/steam-chroot

Run the wrapper script as root to start Steam:

root #steam-chroot

Flatpak[edit | edit source]

A quite simple, fast and clean method (e.g. 32-bit dependencies do not need to be compiled) of installing Steam is to use the Flatpak package com.valvesoftware.Steam from Flathub:

user $flatpak install flathub com.valvesoftware.Steam
user $flatpak run com.valvesoftware.Steam

Steam will update itself and install its files in the ~/.var/app/com.valvesoftware.Steam directory.

Client troubleshooting[edit | edit source]

See Steam/Client troubleshooting.

Games troubleshooting[edit | edit source]

See Steam/Games troubleshooting.

Removal[edit | edit source]

Removing a manual installation[edit | edit source]

Remove the Steam dependencies:

root #emerge --deselect @steam
root #emerge --ask --depclean

Remove the Steam executable and Portage configuration:

root #rm /usr/bin/steam
root #rm /etc/portage/sets/steam
root #rm -rf /etc/portage/package.*/steam

Remove the Steam directory from the user accountː

user $rm -rf ~/.local/share/Steam

Remove all files and directories from the user account which contain 'steam' (case-insensitive) in the name:

Warning
Use with caution as this may remove files and directories unrelated to Steam.
user $find ~ -iname '*steam*' -exec rm -ri {} \;

Removing an external repository installation[edit | edit source]

Remove the steam-launcher ebuild:

root #emerge --ask --depclean --verbose games-util/steam-launcher

If it was installed, remove the steam-meta ebuild:

root #emerge --ask --depclean --verbose games-util/steam-meta

Asking for help[edit | edit source]

The best place to ask for help is the Steam thread on the Gentoo Forums. If a solution to an issue is confirmed by others, add it to this page or the relevant troubleshooting subpage. Please do not remove content without discussion, unless it is obviously wrong.

See also[edit | edit source]

  • Games — a landing page for many of the games (especially open source variants) available in Gentoo's main ebuild repository.
  • Steam Controller — a game controller developed by Valve.

External resources[edit | edit source]

References[edit | edit source]

  1. https://steamcommunity.com/games/221410/announcements/detail/1696055855739350561
  2. chewi. Issues on 4.18.9-gentoo kernel, Steam for Linux, September 24th, 2018. Retrieved on September 25th, 2018.
  3. Valve. The Steam Browser is Disabled, Steam Support Knowledge Base, December 12th, 2016. Retrieved on January 12th, 2019.
  4. Zac Medico. Portage 2.3.64 News, Portage Git repository, April 18th, 2019. Retrieved on September 29th, 2019.
This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.