Não é possível instalar o libc6 devido a problemas multiarch no Ubuntu

0

Como eu dpkg-query -L libc6 não funciona na minha máquina, não consigo instalar nenhum pacote.

# apt-cache policy libc6
libc6:
  Installed: 2.15-0ubuntu10.15
  Candidate: 2.15-0ubuntu10.17
  Version table:
     2.15-0ubuntu10.17 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
 *** 2.15-0ubuntu10.15 0
        100 /var/lib/dpkg/status
     2.15-0ubuntu10 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

# apt-cache policy libc6
libc6:
  Installed: 2.15-0ubuntu10.15
  Candidate: 2.15-0ubuntu10.17
  Version table:
     2.15-0ubuntu10.17 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
 *** 2.15-0ubuntu10.15 0
        100 /var/lib/dpkg/status
     2.15-0ubuntu10 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libc6 libc6-dbg libc6-dev libc6-dev-i386 libc6-i386
Suggested packages:
  glibc-doc
The following packages will be upgraded:
  libc6 libc6-dbg libc6-dev libc6-dev-i386 libc6-i386
5 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
4 not fully installed or removed.
Need to get 0 B/16.0 MB of archives.
After this operation, 13.3 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ... 792434 files and directories currently installed.)
Preparing to replace libc6:amd64 2.15-0ubuntu10.15 (using .../libc6_2.15-0ubuntu10.17_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libc6_2.15-0ubuntu10.17_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.15-0ubuntu10.17_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Agora, para aprofundar o problema, eu extraí o script preinst do /var/cache/apt/archives/libc6_2.15-0ubuntu10.17_amd64.deb e executo-o com o ./preinst upgrade 2.15-0ubuntu10.15 que revelou que há um problema com

# dpkg-query -L libc6
dpkg-query: error: --listfiles needs a valid package name but 'libc6' is not: ambiguous package name 'libc6' with more than one installed instance

Use --help for help about querying packages.

mostrando os pacotes instalados, dê:

# dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                  Version                         Architecture                    Description
+++-=====================================================-===============================-===============================-===============================================================================================================
ii  libc6:amd64                                           2.15-0ubuntu10.15               amd64                           Embedded GNU C Library: Shared libraries
rc  libc6:i386                                            2.15-0ubuntu10.15               i386                            Embedded GNU C Library: Shared libraries

Tentando se livrar de todos os pacotes i386 com:

aptitude purge 'dpkg --get-selections | grep ":i386" | awk '{print $1}''

Infelizmente, o problema continua com dpkg -l libc6 mostrando a arquitetura i386.

Agora estou preso. Alguma idéia?

    
por native-human 22.03.2017 / 17:43

1 resposta

0

Conseguimos isso de alguma forma com os seguintes passos:

aptitude download libc6

mkdir tmp
dpkg-deb -R libc6_2.15-0ubuntu10.17_amd64.deb tmp
# edit DEBIAN/preinst replaced 'dpkg-query -L libc6' with 'dpkg-query -L libc6:amd64'
dpkg-deb -b tmp libc6_2.15-0ubuntu10.17fixed_amd64.deb

dpkg -i libc6_2.15-0ubuntu10.17fixed_amd64.deb

Agora consegui resolver os conflitos. Para se livrar de todos os pacotes i386 que usei agora:

dpkg -l | grep :i386 | awk '{ print $2 }' | xargs dpkg -P

e agora parece que me livrei dos pacotes i386:

dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                  Version                         Architecture                    Description
+++-=====================================================-===============================-===============================-===============================================================================================================
ii  libc6:amd64                                           2.15-0ubuntu10.17               amd64                           Embedded GNU C Library: Shared libraries
    
por native-human 23.03.2017 / 11:32