如何在20.04版本的focal上安装Steam

尝试使用Ubuntu软件安装steam-installer,出现了这个非常有帮助的错误。

enter image description here

然后我尝试了命令行:

$ sudo apt install steam-installer

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 steam-installer : Depends: steam (= 1:1.0.0.61-2ubuntu3)
E: Unable to correct problems, you have held broken packages.

所以steam-installer依赖于无法解决的steam!什么?Ubuntu的Steam软件包是坏的吗?

更新:

$ sudo apt update
Hit:1 http://mx.archive.ubuntu.com/ubuntu focal InRelease                                                           
Hit:2 http://mx.archive.ubuntu.com/ubuntu focal-updates InRelease                                                   
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://mx.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libssl1.1 openssl python3-software-properties software-properties-common software-properties-gtk
  ubuntu-advantage-tools
6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 2 902 kB of archives.
After this operation, 13.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.10 [1 322 kB]
Get:2 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssl amd64 1.1.1f-1ubuntu2.10 [620 kB]
Get:3 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 ubuntu-advantage-tools amd64 27.4.2~20.04.1 [859 kB]
Get:4 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 software-properties-common all 0.99.9.8 [10.6 kB]
Get:5 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 software-properties-gtk all 0.99.9.8 [66.0 kB]
Get:6 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-software-properties all 0.99.9.8 [24.9 kB]
Fetched 2 902 kB in 4s (661 kB/s)                      
Preconfiguring packages ...
(Reading database ... 418427 files and directories currently installed.)
Preparing to unpack .../0-libssl1.1_1.1.1f-1ubuntu2.10_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.10) over (1.1.1f-1ubuntu2.9) ...
Preparing to unpack .../1-openssl_1.1.1f-1ubuntu2.10_amd64.deb ...
Unpacking openssl (1.1.1f-1ubuntu2.10) over (1.1.1f-1ubuntu2.9) ...
Preparing to unpack .../2-ubuntu-advantage-tools_27.4.2~20.04.1_amd64.deb ...
Unpacking ubuntu-advantage-tools (27.4.2~20.04.1) over (27.4.1~20.04.1) ...
Preparing to unpack .../3-software-properties-common_0.99.9.8_all.deb ...
Unpacking software-properties-common (0.99.9.8) over (0.98.9.5) ...
Preparing to unpack .../4-software-properties-gtk_0.99.9.8_all.deb ...
Unpacking software-properties-gtk (0.99.9.8) over (0.98.9.5) ...
Preparing to unpack .../5-python3-software-properties_0.99.9.8_all.deb ...
Unpacking python3-software-properties (0.99.9.8) over (0.98.9.5) ...
Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.10) ...
Setting up python3-software-properties (0.99.9.8) ...
Setting up ubuntu-advantage-tools (27.4.2~20.04.1) ...
Setting up openssl (1.1.1f-1ubuntu2.10) ...
Setting up software-properties-common (0.99.9.8) ...
Setting up software-properties-gtk (0.99.9.8) ...
Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
Processing triggers for shared-mime-info (1.15-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libglib2.0-0:amd64 (2.64.6-1~ubuntu20.04.4) ...
Processing triggers for libc-bin (2.31-0ubuntu9.3) ...
Processing triggers for man-db (2.9.1-1) ...

更新2:

$ sudo apt install steam
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 steam:i386 : Depends: libgl1-mesa-dri:i386 (>= 17.3) but it is not going to be installed or
                       libtxc-dxtn0:i386 but it is not installable
              Depends: libgl1-mesa-glx:i386 but it is not going to be installed
              Depends: libgpg-error0:i386 (>= 1.10) but it is not going to be installed
              Depends: libudev1:i386 but it is not going to be installed
              Depends: libxcb-dri3-0:i386 (>= 1.11.1) but it is not going to be installed
              Depends: libxinerama1:i386 (>= 2:1.1.1) but it is not going to be installed
              Depends: libc6:i386 (>= 2.15) but it is not going to be installed
              Depends: libstdc++6:i386 (>= 4.8) but it is not going to be installed
              Depends: libx11-6:i386 but it is not going to be installed
              Recommends: libxss1:i386 but it is not going to be installed
              Recommends: mesa-vulkan-drivers:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sources.list:

#deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mx.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://mx.archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mx.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://mx.archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mx.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://mx.archive.ubuntu.com/ubuntu/ focal universe
deb http://mx.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://mx.archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mx.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://mx.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://mx.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://mx.archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mx.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://mx.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

我想我从来没有摆弄过那个。

不,它没有坏。通常安装都没有问题。确保您的系统已经完全更新。很可能您有其他需要修正的问题,所以在尝试安装新软件之前,请先解决这些问题。 - ChanganAuto
Ubuntu今天刚刚更新了自己。我可能还会遇到哪些其他问题呢? - user1785730
1这不是Steam。你请求了一个不可能的情况通常意味着你没有使用原始的Ubuntu系统,而是进行了一些修改。这些修改现在阻止了Steam的安装。要么恢复这些修改以返回到原始系统,要么编辑你的问题清楚地描述这些修改,以便我们可以提供替代方案。 - user535733
1蒸汽包并没有损坏,但您的软件包管理系统似乎有问题。请编辑您的问题并将sudo apt updatesudo apt upgrade的输出粘贴到问题中。 - Nmath
除了@Nmath的要求之外,请编辑您的问题并粘贴apt policy steam-installer的输出。另外,您为什么不使用Steam官方网站上的官方安装程序steam-latest.deb呢? - Organic Marble
@user535733:什么是“标准Ubuntu”?是指全新安装的系统吗?我刚刚安装了一些软件包。 - user1785730
@OrganicMarble:其实不是的。我只是假设Ubuntu的软件包是最不痛苦的方式。我的意思是,这就是Ubuntu(或任何Linux发行版)的伟大之处:软件包管理器。 - user1785730
我多年来一直使用 Steam,包括在我的当前的 Ubuntu 20.04 安装上,但我从未听说过 steam-installer 这个软件包。我在软件源中看到它,但它并没有安装在我的电脑上。我安装的软件包是 steam-launcher - Organic Marble
@Nmath:我已经根据要求更新了我的问题。有趣的是,既然软件更新程序今天已经运行过了,为什么还会有可用的升级呢?这不够吗? - user1785730
不管怎样,有人试过安装steam-installer吗?有没有问题? - user1785730
不要安装steam-installer。请从Steam官方网站下载官方软件包。它会添加一个软件源,并通过软件包系统提供未来的更新。 - Organic Marble
我刚刚尝试安装steam而不是steam-installer。输出结果在我的问题中。 - user1785730
可能有一些PPA与您的软件包冲突吗?您能同时发布cat /etc/apt/sources.list吗? - Nmath
@Nmath: 我已经发布了/etc/apt/sources.list - user1785730
似乎没有什么异常情况——@Organic Marble刚刚发布的答案可能是最好的解决方案。不过我很好奇,你是否能够使用sudo apt install libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libgpg-error0:i386 libudev1:i386 libxcb-dri3-0:i386 libxinerama1:i386 libc6:i386 libstdc++6:i386 libx11-6:i386手动安装这些依赖项——不过我建议先尝试一下Organic Marble的解决方案。 - Nmath
Steam需要386库。你有没有用dpkg --add-architecture i386添加过这个架构?然后再次运行apt-get update,然后尝试安装steam。 - ubfan1
请注意,官方的 Steam 安装不会预装 steamsteam-installer 这两个软件包。 - Organic Marble
这个回答解决了你的问题吗?如何恢复默认软件源?在全新的20.04 LTS上,只需执行三个命令即可正常安装 - sudo dpkg --add-architecture i386; sudo apt-get update; sudo apt-get install steam - N0rbert
@Norbert,这个方法可能有效,但是如果你从供应商的网站安装,'steam'软件包将不会被安装。原帖中的用户手动安装了一个比20.04仓库中提供的版本更新的'libc6',导致了依赖关系的混乱。 - Organic Marble
1个回答

你正在走一条只会带来痛苦的道路。
从Steam官网下载并安装官方软件包。https://store.steampowered.com/ 这样做将安装软件包steam-launcher并添加ppasteampowered.org 首次运行时,将安装一堆其他软件包:
Steam需要安装以下附加软件包: libc6:amd64 libc6:i386 libegl1:amd64 libegl1:i386 libgbm1:amd64 libgbm1:i386 libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libgl1:amd64 libgl1:i386 steam-libs-amd64:amd64 steam-libs-i386:i386 xdg-desktop-portal xdg-desktop-portal-gtk xterm
这些软件包有很多依赖项也会被安装。 既不会安装steam也不会安装steam-installer 未来的更新将通过软件包系统自动处理。

这会打开Ubuntu软件,但是会出现一个错误:无法安装文件:不支持 - user1785730
首先下载文件。您将需要通过命令行或使用Gdebi安装下载的.deb文件。我使用后者,所以不记得如何通过命令行安装,尽管我确定这个网站上有相关信息。 - Organic Marble
1使用sudo apt install ./steam_latest.deb命令成功了。从这可以推断出Ubuntu软件应用程序出现了故障。 - user1785730
我觉得"Ubuntu软件"相当专注于Snaps。我自己从来不用它。 - Organic Marble
3不,Ubuntu软件并没有出错,问题也不在于它专注于snaps。问题在于商店本身就是一个snap,因此默认情况下,它只能访问用户的空间。当您选择直接从浏览器打开.deb文件,而不是将其下载到“下载”文件夹时,浏览器会将其下载到一个对snaps不可访问的临时文件夹中,因此会出现错误。 - ChanganAuto
@长安汽车 我在安装系统时会删除快照,所以很高兴接受您的评论是正确的。 - Organic Marble
1@OrganicMarble 你可以在一个全新安装的系统上确认这一点(虚拟机也可以,显然)。尝试直接从浏览器打开任何 .deb 文件,它将会失败。将其下载到本地,然后双击它,它将像以前一样正常工作。 - ChanganAuto
蒸汽仍然无法使用,有关libc6的一些问题。我已经提出了一个新问题:https://askubuntu.com/q/1379785/1074311 - user1785730
@长安汽车 我不需要测试它!我总是准备好相信关于快照的坏事。 - Organic Marble
1@长安汽车:我认为下载对话框首先不应该提供使用“软件安装”打开文件的选项,如果已知这种方式无法运行。 - user1785730
1@OrganicMarble 但是...但是...想想现在有了这么多的限制,安全性会更高啊 :D 这些烦恼只是为了这样的巨大进步付出的小代价。它们占用更多的空间也不是问题,现在即使是大容量的固态硬盘也相对便宜。 - ChanganAuto
@user1785730 真奇怪。我刚在虚拟机上安装了它,为了确保我对答案的措辞是正确的。 - Organic Marble
@OrganicMarble 下载对话框不应该在已知无法打开文件的情况下提供打开选项 是的,我们知道这一点,但浏览器并不知道,它们仍然具有与以前相同的文件关联,并且很难仅通过更改来影响浏览器的行为。 - ChanganAuto
@user1785730 我收到一个弹窗,上面写着你缺少以下32位库文件,Steam可能无法运行:libc.so.6。启动器运行了,但我没有尝试运行任何游戏(因为是虚拟机)。 - Organic Marble
1@OrganicMarble:是的,我也得到了同样的结果。但启动器无法运行。我认为这是因为我已经安装了libc6而不是libc6-i386。 - user1785730
在vm测试安装中,奇怪的是,libc6和libc6:i386都被安装了,所以我真的不确定它在抱怨什么。这两个软件包的版本都是2.31-0ubuntu9.2。 - Organic Marble