跳至內容

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/疑難解答

另見