跳转到内容

Steam

来自 Arch Linux 中文维基

本文或本节需要翻译。要贡献翻译,请访问简体中文翻译团队

附注: 更新部分需要翻译(在 Talk:Steam# 中讨论)

Steam 是 Valve 公司推出的著名游戏分发平台。

注意:对于 Linux 平台,Steam 只支持最新的 Ubuntu 或 Ubuntu 的长期支持版本[1][2]。如果在 Arch Linux 上使用 Steam 遇到问题,请不要向 Valve 寻求支持。

安装

启用 multilib 仓库并安装 steam 软件包(推荐)。

同时,你也可以安装 steam-native-runtimeAUR 以使用由原生系统库驱动的 Steam(通过 steam-native 启动),参阅/疑难解答#Steam runtime

注意:If you are installing for the first time, you may be prompted for the 32-bit Vulkan driver package. By default, pacman alphabetically chooses lib32-nvidia-utils, which can introduce issues such as being unable to use Vulkan at all due to the driver not corresponding to your GPU vendor.

在 Arch Linux 上运行 Steam 需要满足以下需求:

提示:It is strongly recommended to install the optional dependency ntsync-autoload (preferably as a dependency) to get better performance and compatibility with Windows games; see Wine#Synchronization primitives for more information.

SteamCMD

安装 steamcmdAUR 以使用命令行版本的 Steam

目录结构

Steam 的默认安装位置是 ~/.local/share/Steam。如果 Steam 无法找到该目录,它会指导你重新安装或选择一个新的安装位置。这篇文章使用 ~/.steam/root 符号链接来表示 Steam 的安装位置。

库文件夹

每一个 Steam 应用都有一个独一无二的应用 ID,你可以通过 Steam Store 的页面路径或在 SteamDB 中来找到它。

Steam 将游戏安装到 LIBRARY/steamapps/common/ 目录下。库文件夹 LIBRARY 一般会是 ~/.steam/root,但是你依然可以选择拥有多个库文件夹如 (Steam > Settings > Storage >(+)Add Drive)。

为了 Steam 能够正确识别游戏,它需要在 LIBRARY/steamapps/ 目录下找到 appmanifest_AppId.acf 文件。 此清单文件使用了KeyValues 格式,并且它的 installdir 的内容决定了游戏的目录名称。

注意:为使从 flathub 安装的 Steam 能够添加另外的驱动器,用户必须授予 Steam 客户端访问该驱动器所在挂载点的权限,可以使用 flatseal 等工具。

用法

steam [ -options ] [ steam:// URL ]

对于可用的命令行选择,详见 Command Line Options article on the Valve Developer Wiki

Steam 也可以接受可选的 Steam URL,详见 Steam browser procotol

启动选项

当你运行一个 Steam 游戏时,Steam 会使用 /bin/sh 执行它的启动命令。 为了让你自由修改启动命令,Steam 提供了启动选项启动选项可以通过右键点击你的游戏库中的游戏,选择属性后点击设置启动选项进行修改。

默认情况下 Steam 只是简单的把你设置的参数字符串添加到游戏的启动命令后。想要设置环境变量或者将一个启动命令作为参数传递给另一个命令,你可以使用 %command% 以表示原启动命令。

示例

  • 仅设置参数: -foo
  • 设置环境变量: FOO=bar BAZ=bar %command% -baz
  • 设置与默认完全不同的命令: othercommand # %command%

提示与技巧

最小化启动

It is possible to have Steam start minimized to the system tray, rather than taking focus. Add -silent to the list of command line arguments; see Desktop entries#Modify desktop files for doing this by default.

Small mode

Steam supports an alternative, minimal UI with just your game list - the store, community and cover collection views are hidden. You can switch to it with View > Small Mode. To go back to the standard UI, select View > Large Mode.

You can also launch Steam with this argument:+open steam://open/minigameslist

Proton Steam-Play

Valve 公司开发了一个兼容性工具Proton,用来使 Steam 可以在 Wine 和其他额外组件上运行。这使得你可以运行很多原本只能在 Windows 平台上运行的游戏(详见 compatibility list)。

此工具开源并且可以从 GitHub 获得。Steam 将在 Steam Play 启用后安装它相适应的 Proton 版本。

Proton 需要在 Steam 客户端启用:Steam > 设置 > 兼容性。你可以为了上述那些没有被 Valve 公司列入白名单的游戏启用 Steam Play。

如果开发者激活,Proton 支持 Easy Anti Cheat 集成,但是 EAC 可能需要某个特定修补版本的 glibc:如果某个游戏据报告可以运行而在您的设备上却不行,请尝试使用 Steam Flatpak,因为其附带了修补的 glibc。另外,设置 procfs 挂载选项 hidepid 为一个加固值可能会导致 Easy Anti-Cheat 失败,并显示错误信息“Launch Error: 261”。

强制使用 Proton

如果需要为某个游戏启用 Proton 或某特定版本的 Proton,右键该游戏,选择属性 > 兼容性 > 强制使用特定 Steam Play 兼容性工具,选择需要的版本。这种做法也可以强制使一个具有 Linux 接口的游戏运行 Windows 版本。

Use Proton outside of Steam

To use Proton outside of Steam, the best way to do so is through umu-launcher.

Take a look at the upstream repository for more information, including its documentation.

提示:Some game launchers have integrated support for umu-launcher. Check Gaming#Getting games for a list of launchers. As of April 2026, Heroic Games Launcher[3] and Lutris[4] are two that support it.
注意:umu-launcher is the backend to use Proton outside of Steam. It is not intended to be user-facing, as it does not have a friendly user interface, and requires terminal usage. It can still be used directly via terminal, if desired, and will provide the same results as using it via a graphical user interface.

Compatibility layers other than Proton

There are compatibility tools other than Proton/Wine.

  • Luxtorpeda — Run games using native Linux engines.
https://luxtorpeda-dev.github.io/ || luxtorpeda-gitAUR
  • Boxtron — Run DOS games using native Linux DOSBox
https://github.com/dreamer/boxtron || boxtronAUR

You can also use protonup-qtAUR to manage them:

  1. Close Steam
  2. Install protonup-qtAUR
  3. Open protonup-qt and install desired tools
  4. Start Steam
  5. In the game properties window, select Force the use of a specific Steam Play compatibility tool and select the desired tool.

Steam Input

When a controller is plugged in while Steam is running, Steam's default behavior is to leave it alone and let games use it as-is. The gamepad's evdev and joystick devices are exposed by the kernel, and games may use them using APIs such as SDL2 as if Steam were not in the picture.

The Steam Input subsystem offers an abstraction layer which allows for more advanced functionality such as rebinding buttons and axes, having game-specific profiles, and doing higher-level button mappings based on in-game actions. The Steam Input Configurator (SIC) is the part of the system that implements this functionality. To enable Steam Input for a controller, go to Steam > Settings > Controller > External Gamepad Settings. Here you will find toggles to Enable Steam Input corresponding to your controller.

Steam Input Configurator

此页面或章节适合移动到 Steam Input Configurator

附注: 没有理由在此处保留如此大的文本,它可以放在自己的文章中(在 Talk:Steam 讨论)

详见Steam Input Configurator以获取配置器使用说明。

当 SIC 为控制器启用时,会出现几个不同的控制器设备:

  • 虚拟 Steam 控制器,用于支持 Steam Input API 的游戏。所有重映射和 Steam 特定功能均可用。
  • 表示模拟 Xbox 360 控制器的 evdev 设备,用于不支持 Steam Input 的游戏。基本重映射生效。
  • 原始控制器 evdev 设备,其输入通过 SIC 传递。重映射未生效,但游戏应默认使用 360 控制器。
  • 上述两个设备的操纵杆模拟设备。

SIC 的行为取决于上下文:

  • 当启动支持 Steam Input API 的游戏时,SIC 使用原生模式。游戏接收“动作”而非原始输入。
    • 这适用于在 Proton 中运行且会在 Windows 上使用 Steam Input 的游戏。
    • 理论上不需要,但模拟的 360 控制器仍然存在。
    • 游戏可选择同时支持 Steam Input 和传统输入 API 库(底层使用 evdev 和操纵杆)。当游戏通过 Steam 启动且为控制器启用 SIC 时,Steam Input 优先级更高。
    • 游戏也可选择仅支持 Steam Input。例如在《Among Us》中,除非运行 SIC,否则游戏手柄无法工作。
  • 当启动不支持 Steam Input 的游戏时,它(不知情地)在传统模式下使用 SIC。游戏接收来自看似 360 控制器的原始输入,但这些输入实际由 SIC 伪造以模拟原生模式的行为。
    • 这适用于使用 evdev 或操纵杆的原生游戏,以及通过 Proton 运行的使用 DirectInput 或 XInput 的 Windows 游戏。
  • 当启动既不支持 Steam Input 也不支持其他游戏手柄 API 的游戏时,SIC 可激活配置文件以模拟游戏手柄支持。
  • 当 Big Picture 获得焦点时,当前 Big Picture 配置文件生效(不可配置)。
  • 当其他任何程序获得焦点时,当前桌面配置文件生效,可通过“Steam > 设置 > 控制器 > 桌面布局”配置。
  • 当任何程序获得焦点时,可通过“Steam > 设置 > 控制器 > 引导按钮和弦布局”配置额外的全局绑定(在 Steam Deck 上不可用)。

游戏根据其手柄支持程度进行评级(取决于控制器型号):

  • 支持您的控制器:表示游戏具有完整控制器支持。即使游戏不使用 Steam Input API 也可实现;重点在于无障碍性,无论 API 如何。
  • 大部分可用您的控制器:表示游戏具有部分手柄支持。即使游戏使用 Steam Input API,某些部分(如《军团要塞2》中)仍无法访问,导致此评级。
  • 不支持控制器:表示游戏没有原生手柄支持。
  • 未知控制器支持:表示 Valve 尚未验证该游戏的控制器支持。

当游戏没有完整手柄支持时,SIC 会尝试填补空白。例如在需要点击操作的《Bloons Tower Defense 5》中,Steam 会自动激活“键盘(WASD)和鼠标”配置文件,让您能用游戏手柄移动和点击。

推荐 Steam Input 用法

使用总结:

  • 启用“配置支持”建议用于增强手柄功能,如自定义重映射或自动修复(如任天堂式按钮重映射或键盘/鼠标)。
  • 对于某些游戏,如果它们不支持传统游戏手柄 API,则启用此功能是必需的。
  • 默认情况下,如果启用此功能,则控制器无法用于非 Steam 游戏,因为 360 控制器优先于原始控制器设备,但默认桌面配置禁用按钮。要修复此问题,您可以:
    • 让配置更改动作集。某些官方桌面配置在按住开始按钮时会切换到游戏手柄模式。如果您的控制器配置无此功能,可添加新动作集,将其设为包含游戏手柄按钮,向开始按钮添加“额外命令”,设为“更改动作集”,并设置该额外命令在长按时激活。
    • 将桌面配置文件设为“游戏手柄”模板。这将传递输入到 360 控制器,使默认设备可用于其他程序。
    • 让其他程序使用原始设备(如果支持)。注意游戏将无法受益于 Steam Input 重映射。
    • 禁用整个功能,使 Steam 完全不创建 360 控制器。注意 Steam 游戏将无法受益于增强的手柄支持。
    • 使用其他游戏时关闭 Steam。

禁用 Steam Input

如果您希望完全禁用 Steam Input,请使用 -nojoy 参数启动 Steam,并单独为每个游戏禁用 Steam Input,因为不存在全局选项。

HiDPI

参见 HiDPI#Steam

无窗口管理器的大屏幕模式

欲从显示管理器Gamescope混成器直接以大屏幕模式启动 Steam:

/usr/share/wayland-sessions/steam-big-picture.desktop
[Desktop Entry]
Name=Steam 大屏幕模式
Comment=以大屏幕模式启动 Steam
Exec=/usr/bin/gamescope -e -- /usr/bin/steam -tenfoot
Type=Application
注意:其中 -tenfoot 选项告诉 Steam 以大屏幕模式启动。

Then instruct your display manager to launch gamescope.

注意:Install pipewire-pulse if the audio settings do not show any audio devices.
警告:polkit needs to be installed to be able to use the "Suspend System", "Turn Off System" and "Restart System" options of the Power menu.
警告:The "Switch to desktop" menu entry softlocks the session. To exit to the display manager you need to run steam -shutdown. To do this from Steam, you can either:
  • Add -steamos3 to the Steam command-line arguments, which makes in the menu entry execute steamos-session-select when selected. You can then add a script with this name in your PATH to customize the behavior; see this guide for an example (note that ~/.local/bin is not part of Arch's default PATH).
    • Be warned that -steamos3 might have other unintended effects.
  • Create a script with this command and add it as a non-Steam game. This creates a "shortcut" to exit back to the display manager.

Steam 远程同乐

注意:Steam 家庭流媒体 已更新为 Steam 远程同乐

Steam 内置对于远程同乐的支持。

前往 Steam 社区指南以了解如何在 Linux 上设置无头模式的流媒体服务。

Steam Controller

通常一个 Steam Controller 手柄需要使用 Steam 界面。不过在非 Steam 原生的 Linux 游戏中这种界面并不很实用。对此,当 Steam 客户端运行时,其会保持一个“桌面配置”。如果你有 Steam Controller 手柄,请在桌面配置中将其设置为通用 XBOX 控制器。只要 Steam 客户端在运行,你可以在其他游戏中使用 Steam Controller 手柄,例如 GOG 的游戏, 就像一个 XBOX 手柄。请确保在“常规手柄设置”已经选择了你的手柄类型。

使用 Proton 时与 Windows 共用游戏

If you use Proton (Steam Play) for launching your games, and still keep a Windows installation for some reason (for example, if some game has problems with anti cheat or if you want to make a comparison tests with Windows), you may want to store your games in a common partition instead of keeping two copies of game one per OS.

To add another folder for library, click on Steam > Settings > Downloads > STEAM LIBRARY FOLDERS, then on the ⊕ (Plus) button.

There are four file systems, that can be read/write by both Windows and Linux.

NTFS

警告:Valve discourages the usage of NTFS to store a Steam library as it may lead to unexpected errors, specially for cases where a library is shared between multiple OSs. You WILL run into problems where games do not start. You WILL run into problems where games crash unexpectedly.

See Using a NTFS disk with Linux and Windows for more information on how to configure that. To launch games from an NTFS drive, follow the steps from Steam/Troubleshooting#Steam Library in NTFS partition.

Using ntfs has disadvantages. It happens often that shaders cache folder becomes corrupted. Messages saying ntfs3: sdb6 ino=1921f, steamapprun_pipeline_cache Looks like your dir is corrupt. You cannot fix that from linux. You need to boot to Windows and use chkdsk for that.

exFAT

该文件系统的缺点之一是不区分大小写。可能会出现类似的提示信息:SteamLibrary has both 'SteamApps' and 'steamapps' directories. This will cause problems. Please fix manually and only keep 'steamapps'。参见 issue #7665

此外,在 exFAT 上创建符号链接也存在问题,因此你无法像在 NTFS 方法中那样使用符号链接 compatdata 的方法。

Btrfs

Btrfs has a fairly mature Windows Driver.

NTFS can be also converted into Btrfs, see Btrfs#NTFS to Btrfs conversion.

This filesystem eliminates most NTFS/exFAT compatibility issues, but sharing a Steam library between Windows and Linux has limitations:

Valve officially discourages sharing Steam libraries between OSes. Even with correct WinBtrfs UID/GID mappings, Windows processes create lock-files and staging folders owned by nobody:100, causing "Disk write failure" or "content file locked" errors in Linux.

After Windows usage you must run:

# chown -R $USER:$USER /path/to/steam_library/steamapps
$ find /path/to/steam_library/steamapps -name "*.lock" -delete
$ rm -rf /path/to/steam_library/steamapps/{downloading,temp}/*

Only then start Steam on Linux. For reliable operation, keep separate libraries per OS.

UDF

This filesystem can be used without issue, but to ensure compatibility, it must be formatted to the correct UDF revision. Linux lacks write support for revisions 2.50 and higher. Therefore, revision 2.01 is required for proper functionality.

The UDF block size must match the logical sector size of the partition. This value can be obtained using blockdev(8):

# blockdev --getss /dev/the_partition_to_be_formatted

The partition is then formatted to UDF using mkfs.udf(8) provided by udftools. For both HDDs and SSDs, the appropriate media type is hd.

# mkfs.udf --utf8 --label=label --blocksize=block-size --media-type=hd --udfrev=0x0201 /dev/the_partition_to_be_formatted

Where:

  • the_partition_to_be_formatted is the name of the target partition (e.g. sdb4, nvme2n5p3 etc.).
  • label is the desired volume label.
  • block-size is the output of the blockdev command.

Alternatively, graphical tools like gparted can be used to handle formatting. They correctly manage UDF revision selection to ensure compatibility.

加速着色器预编译

某些情况下着色器预编译可能仅使用一个核心,用户可以修改此类行为,例如改为 8 个核心:

~/.steam/steam/steam_dev.cfg
unShaderBackgroundProcessingThreads 8

Disable HTTP2 for faster downloads

Some systems and configurations seem to have issues with HTTP2. Disabling HTTP2 will probably yield faster downloads on those configurations. You can either use the console command @nClientDownloadEnableHTTP2PlatformLinux 0 or set it in steam_dev.cfg like so:

~/.steam/steam/steam_dev.cfg
@nClientDownloadEnableHTTP2PlatformLinux 0


注意:The bug that caused this should be fixed in the current steam client. This should not improve speeds anymore

Proton 以外的其它兼容层

除了 Proton/Wine,还有其他兼容工具可用:

  • Luxtorpeda — 使用原生 Linux 引擎运行游戏。
https://luxtorpeda-dev.github.io/ || luxtorpeda-gitAUR
  • Boxtron — 使用原生 Linux 的 DOSBox 运行 DOS 游戏。
https://github.com/dreamer/boxtron || boxtronAUR

也可以使用 protonup-qtAUR 来管理这些工具:

  1. 关闭 Steam
  2. 安装 protonup-qtAUR
  3. 打开 protonup-qt 并安装你想要的兼容工具
  4. 启动 Steam
  5. 在游戏的“属性”窗口中,勾选“强制使用特定的 Steam Play 兼容工具”,然后选择你想要的工具。


使用独立显卡运行游戏

在使用混合图形技术的笔记本电脑上,Steam 默认使用集成显卡运行游戏,欲使用性能更为强劲的独立显卡运行游戏,请参阅 PRIME#PRIME GPU 分载

Flatpak

本文或本章节可能需要合并到Flatpak/Application-specific troubleshooting

附注: Flatpak is not supported.(在 ArchWiki talk:Requests#Contain Flatpak application troubleshooting to a subpage 中讨论)
警告:The Flatpak version of Steam is not verified and not vetted by Valve Corporation. The Arch Linux developers also have no say in it, and do not give technical support to it. Use it at your own risk. To use Steam on Arch, the recommended way is via the steam package.
注意:Installing Steam from Flathub/Flatpak will fix many of the issues faced on the client but will require alternative, less documented forms of troubleshooting on the long run.

Steam can also be installed with Flatpak as com.valvesoftware.Steam from Flathub. The easiest way to install it for the current user is by using the Flathub repository:

$ flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak --user install flathub com.valvesoftware.Steam
$ flatpak run com.valvesoftware.Steam

The Flatpak application currently does not support themes. Also you currently cannot run games via optirun/primusrun, see Issue#869 for more details.

Steam installed via Flatpak is not able to access your home directory and overriding this will cause Steam to not run because it is not safe. However, you can freely add directories outside the home directory. If you want to add an external library, run the following command to add it:

$ flatpak override --user com.valvesoftware.Steam --filesystem=/path/to/directory

Launching Steam with Flatpak might warn you about installing the steam-devices package. This package currently does not exist but game-devices-udevAUR can be installed instead, see Gamepad#Device permissions.

DISPLAY variable not configured

本文或本章节的语言、语法或风格需要改进。参考:帮助:风格

原因:This is uncited and not cross-linked to properly(在Talk:Steam讨论)

When the $DISPLAY variable is improperly configured the following error may arise:

The unofficial Steam Flatpak app requires a correctly-configured desktop session, which must provide the DISPLAY environment variable to the D-Bus session bus activation environment.

On systems that use systemd --user, the DISPLAY environment variable must also be present in the systemd --user activation environment.

This is usually achieved by running:

dbus-update-activation-environment DISPLAY

during desktop environment startup.

For more details, please see: https://github.com/ValveSoftware/steam-for-linux/issues/10554

Often times this issue is caused by the "Fallback to X11 windowing system" option. Global default environment variables for flatpak could also affect steam and cause steamwebhelper crashes. Disable them via Flatseal or the CLI.

For minimal setups using only a compositor, xwayland-satellite may help.

Flatpak 的 CJK 字体问题

如果在游戏中遇到中日韩文字无法显示的问题,这可能是因为 org.freedesktop.Platform 默认不包含所需字体。首先尝试挂载本地字体目录:

$ flatpak run --filesystem=~/.local/share/fonts --filesystem=~/.config/fontconfig com.valvesoftware.Steam

如果无效,可以尝试直接将字体文件复制到 org.freedesktop.Platform 的目录中来使其可用,例如复制到:

/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/版本号/哈希值/files/etc/fonts/conf.avail
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/版本号/哈希值/files/etc/fonts/conf.d 
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/版本号/哈希值/files/share/fonts

Flatpak 版 Steam 启动(run)问题

启动后,Steam 会尝试下载一些文件,并显示一个进度条。如果此时崩溃,你可以尝试为 Flatpak 软件包授予额外权限:

$ flatpak permission-set background background com.valvesoftware.Steam yes
$ flatpak run com.valvesoftware.Steam

也可以安装 flatseal 工具控制其权限。

SteamCMD in flatpak

SteamCMD can also be used within the flatpak.

$ flatpak run --command=steamcmd com.valvesoftware.Steam

降低显存占用的 Steam 设置

这对显存较小的显卡很有帮助。

复制一份 Steam 桌面项

$ cp /usr/share/applications/steam.desktop ~/.local/share/applications/steam_minimal.desktop

修改新复制文件的 Exec=Name= 行:

~/.local/share/applications/steam_minimal.desktop
Name=Steam Minimal
Exec=/usr/bin/steam -cef-disable-gpu-compositing -cef-disable-gpu steam://open/minigameslist %U

当启动 Steam Minimal 时,您会看到一个索然无味的界面,不过已经足以安装和运行游戏。运行原先标准的 Steam 则会启动完整的 Steam 客户端。

Limit permission to create arbitrary keyboard input to a specific user group

By default, the Steam package will place an udev rule, which basically allows any logged in user to create arbitrary (globally available) input devices which includes virtual keyboards. This may allow things like sandbox escape.

The following pacman hook can be used to modify the global uinput permission to be only granted to a specific user group.

注意:This only gives you any benefit if you use a dedicated user account just for gaming. When logged into this user, all possible security issues with having user accessible uinput still apply!
/etc/pacman.d/hooks/20-steam-input.hook
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = steam

[Action]
Description = Patching out uaccess for uinput in 60-steam-input.rules
When = PostTransaction
Exec = /usr/bin/sed -i '/^KERNEL=="uinput"/s/TAG+="uaccess"/GROUP="steam"/g' /usr/lib/udev/rules.d/60-steam-input.rules

When creating the group, be sure to create a system group:

# groupadd --system steam

Then add the users, you want to be able to use "Steam Input", to this group.

疑难解答

参见 Steam/疑难解答

另见