如何在Ubuntu 20.04 focal上安装libc6-i386?

重复?

链接的问题中,我发布了我的sources.list,并被认为没有什么异常。那么,我的问题怎么会成为修复sources.list的重复问题呢?这有什么帮助吗?

原始问题:

我从他们的网站安装了Steam。Steam想要安装一堆软件包,但在这个错误停止:

Steam needs to install these additional packages:
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

Press return to proceed with the installation: 
......
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libegl1 is already the newest version (1.3.2-1~ubuntu0.20.04.1).
libegl1 set to manually installed.
libgbm1 is already the newest version (21.0.3-0ubuntu0.3~20.04.5).
libgbm1 set to manually installed.
libgl1 is already the newest version (1.3.2-1~ubuntu0.20.04.1).
libgl1 set to manually installed.
libgl1-mesa-dri is already the newest version (21.0.3-0ubuntu0.3~20.04.5).
libgl1-mesa-dri set to manually installed.
libc6 is already the newest version (2.31-0ubuntu9.3).
libc6 set to manually installed.
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:
 libc6 : Breaks: libc6:i386 (!= 2.31-0ubuntu9.3) but 2.31-0ubuntu9.2 is to be installed
 libc6:i386 : Breaks: libc6 (!= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.3 is to be installed
E: Unable to correct problems, you have held broken packages.

手动安装libc6-386也没有成功:
$ sudo apt install libc6-i386
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:
 libc6-i386 : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.3 is to be installed
E: Unable to correct problems, you have held broken packages.

最新消息:

$ apt policy libc6
libc6:
  Installed: 2.31-0ubuntu9.3
  Candidate: 2.31-0ubuntu9.3
  Version table:
 *** 2.31-0ubuntu9.3 100
        100 /var/lib/dpkg/status
     2.31-0ubuntu9.2 500
        500 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
     2.31-0ubuntu9 500
        500 http://mx.archive.ubuntu.com/ubuntu focal/main amd64 Packages
$ apt policy libc6-i386
libc6-i386:
  Installed: (none)
  Candidate: 2.31-0ubuntu9.2
  Version table:
     2.31-0ubuntu9.2 500
        500 http://mx.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
     2.31-0ubuntu9 500
        500 http://mx.archive.ubuntu.com/ubuntu focal/main amd64 Packages

1我想知道版本2.31-0ubuntu9.3的libc6-i386是从哪里来的。在测试安装中,我得到了版本...9.2。你能把apt policy libc6apt policy libc6:i386的输出添加到你的问题中吗?我怀疑可能涉及到了一个ppa。 - Organic Marble
我将输出添加到了我的问题中。我必须承认,对于这个2.31-0ubuntu9.*的事情,我一点也不知道是什么意思。 - user1785730
看起来 libc6 的 9.3 版本是手动安装的,它并不来自任何软件源。也许这是之前尝试安装 Steam 时留下的。我建议将其移除,并从 focal-updates 安装 9.2 版本。一旦你这样做了,i386 版本应该可以安装。 - Organic Marble
我确定除了Steam之外,我没有安装任何不来自Ubuntu软件源的东西。 - user1785730
如果你查看apt policy libc6的输出,你会发现安装的版本并不来自当前系统上使用的任何仓库(以100开头的那一行,请注意在此之后列出的所有其他版本都给出了一个仓库)。它可能来自于你已经移除的ppa。 - Organic Marble
我也没有弄过 PPA。 - user1785730
我只能报告您的软件包管理器输出的内容。您可以继续与我争论,或者您可以尝试通过移除那个有问题的软件包来修复您的系统。 - Organic Marble
apt remove libc6 想要移除一个庞大的软件包列表,警告我将会删除一些必要的软件包! - user1785730
你在过去的某个时候搞乱了你的系统。不要移除这个软件包,你能用Synaptic或者Aptitude降级它吗?老实说,我不知道那样会不会有效。 - Organic Marble
我不知道怎么做。 - user1785730
如果你已经安装了 synaptic,你可以找到这个软件包,然后在“软件包”菜单中点击“强制版本”,选择框中选择9.2版本。但是如果你的系统上有很多其他软件包依赖于它,这可能会非常麻烦。https://i.imgur.com/Coc8urO.png - Organic Marble
这个操作还会删除很多软件包,比如build-essential、g++、libboost-<various>和一些*-dev软件包。 - user1785730
1这真是不幸,我已经没有任何主意了。 - Organic Marble
你可以尝试使用aptitude命令,运行sudo apt install aptitude将安装该软件包,然后你可以通过sudo aptitude -f install libc6-i386再次尝试安装你的软件包。 - Error404
你的系统可能缺少 focal-security 存储库。此外,你不应该安装 2.31-0ubuntu9.3 版本的 libc,而应该安装 2.31-0ubuntu9.2 版本。你需要尝试运行 sudo aptitude install libc6=2.31-0ubuntu9.2 来解决当前的问题。 - N0rbert
1请运行sudo aptitude install libc6=2.31-0ubuntu9.2 - N0rbert
1个回答

N0rbert的评论让我找对了方向,但仍然需要删除一长串的软件包:
$ sudo aptitude install libc6=2.31-0ubuntu9.2
The following packages will be DOWNGRADED:
  libc6 
0 packages upgraded, 0 newly installed, 1 downgraded, 0 to remove and 14 not upgraded.
Need to get 2 715 kB of archives. After unpacking 0 B will be used.
The following packages have unmet dependencies:
 libc6-dbg : Depends: libc6 (= 2.31-0ubuntu9.3) but 2.31-0ubuntu9.2 is to be installed
 libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.3) but 2.31-0ubuntu9.2 is to be installed
The following actions will resolve these dependencies:

      Remove the following packages:                                                       
1)      build-essential [12.8ubuntu1.1 (focal-updates, now)]                               
2)      g++ [4:9.3.0-1ubuntu2 (focal, now)]                                                
3)      g++-9 [9.3.0-17ubuntu1~20.04 (focal-security, focal-updates, now)]                 
4)      libboost-atomic1.71-dev [1.71.0-6ubuntu6 (focal, now)]                             
5)      libboost-chrono1.71-dev [1.71.0-6ubuntu6 (focal, now)]                             
6)      libboost-date-time1.71-dev [1.71.0-6ubuntu6 (focal, now)]                          
7)      libboost-filesystem-dev [1.71.0.0ubuntu2 (focal, now)]                             
8)      libboost-filesystem1.71-dev [1.71.0-6ubuntu6 (focal, now)]                         
9)      libboost-regex-dev [1.71.0.0ubuntu2 (focal, now)]                                  
10)     libboost-regex1.71-dev [1.71.0-6ubuntu6 (focal, now)]                              
11)     libboost-serialization1.71-dev [1.71.0-6ubuntu6 (focal, now)]                      
12)     libboost-system1.71-dev [1.71.0-6ubuntu6 (focal, now)]                             
13)     libboost-thread-dev [1.71.0.0ubuntu2 (focal, now)]                                 
14)     libboost-thread1.71-dev [1.71.0-6ubuntu6 (focal, now)]                             
15)     libboost1.71-dev [1.71.0-6ubuntu6 (focal, now)]                                    
16)     libc6-dbg [2.31-0ubuntu9.3 (now)]                                                  
17)     libc6-dev [2.31-0ubuntu9.3 (now)]                                                  
18)     libexpat1-dev [2.2.9-1build1 (focal, now)]                                         
19)     libfreetype-dev [2.10.1-2ubuntu0.1 (focal-security, focal-updates, now)]           
20)     libfreetype6-dev [2.10.1-2ubuntu0.1 (focal-security, focal-updates, now)]          
21)     libicu-dev [66.1-2ubuntu2.1 (focal-security, focal-updates, now)]                  
22)     libjpeg-dev [8c-2ubuntu8 (focal, now)]                                             
23)     libjpeg-turbo8-dev [2.0.3-0ubuntu1.20.04.1 (focal-security, focal-updates, now)]   
24)     libjpeg8-dev [8c-2ubuntu8 (focal, now)]                                            
25)     libncurses-dev [6.2-0ubuntu2 (focal, now)]                                         
26)     libpng-dev [1.6.37-2 (focal, now)]                                                 
27)     libpython3-dev [3.8.2-0ubuntu2 (focal, now)]                                       
28)     libpython3.8-dev [3.8.10-0ubuntu1~20.04.1 (focal-security, focal-updates, now)]    
29)     libstdc++-9-dev [9.3.0-17ubuntu1~20.04 (focal-security, focal-updates, now)]       
30)     libtiff-dev [4.1.0+git191117-2ubuntu0.20.04.2 (focal-security, focal-updates, now)]
31)     python3-dev [3.8.2-0ubuntu2 (focal, now)]                                          
32)     python3.8-dev [3.8.10-0ubuntu1~20.04.1 (focal-security, focal-updates, now)]       
33)     zlib1g-dev [1:1.2.11.dfsg-2ubuntu1.2 (focal-updates, now)]                         

      Leave the following dependencies unresolved:                                         
34)     dpkg-dev recommends build-essential                                                
35)     gcc recommends libc6-dev | libc-dev                                                
36)     cython3 recommends python3-dev                                                     
37)     gcc-9 recommends libc6-dev (>= 2.13-0ubuntu6)                                      
38)     gdb recommends libc-dbg                                                            
39)     libgcc-9-dev recommends libc6-dev (>= 2.13-0ubuntu6)                               
40)     libpython3.8-dev recommends libc6-dev | libc-dev                                   
41)     python3.8-dev recommends libc6-dev | libc-dev                                      
42)     python3-pip recommends build-essential                                             
43)     python3-pip recommends python3-dev (>= 3.2)                                        

因此,我也强制安装了2.31-0ubuntu9.2版本的libc6-devlibc6-dbg
$ sudo aptitude install libc6=2.31-0ubuntu9.2 libc6-dev=2.31-0ubuntu9.2 libc6-dbg=2.31-0ubuntu9.2

这个命令运行得很顺利。Steam现在可以正常工作了。
然而,还有一个问题:我是怎么搞砸的?我为什么一开始就得到了libc6=2.31-0ubuntu9.3?我应该为此提一个新问题吗?

很高兴你解决了这个问题。在过去的某个时候,你可能安装了一些东西,也许你并不知情,它添加了一个ppa并引入了一堆比存储库中更新的软件包。随后,该ppa被移除了。回答这样的问题需要深入研究你系统的历史记录,以及你过去安装和卸载的内容;我不确定是否有人能为你解答这个问题。 - Organic Marble