Instalando o pacote contendo glib.h

2

Estou tentando compilar o código que usa o glib.h. Eu encontrei na internet que o pacote libglib2.0-dev contém. Mas não consigo instalá-lo.

Aqui está a saída do meu console:

> sudo apt-get install libglib2.0-dev
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:
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.48.0-1ubuntu4) but 2.48.2-0ubuntu1 is to be installed
                  Depends: libglib2.0-bin (= 2.48.0-1ubuntu4)
E: Unable to correct problems, you have held broken packages.

E do aptitude:

> sudo aptitude install libglib2.0-dev
The following NEW packages will be installed:
  libelf1:i386{a} libffi6:i386{a} libglib2.0-0:i386{ab} 
  libglib2.0-bin:i386{ab} libglib2.0-dev{b} libpcre3:i386{a} 
  libpcre3-dev{a} libpcre32-3{a} libpcrecpp0v5{a} libselinux1:i386{a} 
  zlib1g:i386{a} 
0 packages upgraded, 11 newly installed, 0 to remove and 1 not upgraded.
Need to get 3680 kB of archives. After unpacking 21,9 MB will be used.
The following packages have unmet dependencies:
 libglib2.0-bin : Conflicts: libglib2.0-bin:i386 but 2.48.0-1ubuntu4 is to be installed.
 libglib2.0-bin:i386 : Conflicts: libglib2.0-bin but 2.48.2-0ubuntu1 is installed.
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.48.0-1ubuntu4) but 2.48.2-0ubuntu1 is installed.
 libglib2.0-0 : Breaks: libglib2.0-0:i386 (!= 2.48.2-0ubuntu1) but 2.48.0-1ubuntu4 is to be installed.
 libglib2.0-0:i386 : Breaks: libglib2.0-0 (!= 2.48.0-1ubuntu4) but 2.48.2-0ubuntu1 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libglib2.0-0:i386 [Not Installed]                  
2)     libglib2.0-bin:i386 [Not Installed]                
3)     libglib2.0-dev [Not Installed]                     



Accept this solution? [Y/n/q/?] 

Quando eu digito 'y', não faz nada. Quando eu seleciono 'n', me propõe desinstalar ~ 1000 pacotes.

> apt policy libglib2.0-dev libglib2.0-0 libglib2.0-bin
libglib2.0-dev:
  Installed: (none)
  Candidate: 2.48.0-1ubuntu4
  Version table:
     2.48.0-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libglib2.0-0:
  Installed: 2.48.2-0ubuntu1
  Candidate: 2.48.2-0ubuntu1
  Version table:
 *** 2.48.2-0ubuntu1 100
        100 /var/lib/dpkg/status
     2.48.0-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libglib2.0-bin:
  Installed: 2.48.2-0ubuntu1
  Candidate: 2.48.2-0ubuntu1
  Version table:
 *** 2.48.2-0ubuntu1 100
        100 /var/lib/dpkg/status
     2.48.0-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Saída de atualização do Apt:

> sudo apt update                
Hit:1 http://pl.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://pl.archive.ubuntu.com/ubuntu xenial-updates InRelease             
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease                   
Hit:4 http://pl.archive.ubuntu.com/ubuntu xenial-backports InRelease           
Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease                        
Hit:6 http://ppa.launchpad.net/embrosyn/cinnamon/ubuntu xenial InRelease       
Get:7 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]     
Hit:8 http://dl.google.com/linux/chrome/deb stable Release                     
Hit:9 http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu xenial InRelease
Hit:10 http://ppa.launchpad.net/noobslab/themes/ubuntu xenial InRelease        
Hit:11 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu xenial InRelease
Fetched 102 kB in 0s (129 kB/s)                   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

> sudo apt list --upgradable     
Listing... Done
qemu/xenial-updates,xenial-security 1:2.5+dfsg-5ubuntu10.14 amd64 [upgradable from: 1:2.5+dfsg-5ubuntu10.10]
N: There are 2 additional versions. Please use the '-a' switch to see them.

Eu não sei como conseguir este pacote.

    
por Hubert Banaszewski 01.06.2017 / 22:04

2 respostas

6

Como primeiro passo, você deve remover 2.48.2-0ubuntu1 versão de libglib2.0-0 com este comando:

sudo dpkg -r --force-all libglib2.0-0

Depois disso, você deve instalar libglib2.0-0 e consertar pacotes quebrados:

sudo apt update
sudo apt install -f
sudo apt install libglib2.0-0 

Finalmente, você pode instalar:

sudo apt install libglib2.0-dev
    
por Ali Razmdideh 01.06.2017 / 23:09
1

De qualquer lugar (provavelmente um PPA instalado em algum momento), você tem arquivos de pacote armazenados em cache para libglib2.0-0 e libglib2.0-bin salvos localmente. Eles são uma versão mais recente do que os dos repositórios oficiais atuais e incompatíveis com eles.

Para esvaziar o cache do seu pacote local e impedir que esses pacotes em cache sejam instalados, você pode opcionalmente (não absolutamente necessário e talvez não tão eficaz quanto desejado) executar

sudo apt clean

Depois disso ou como única etapa, você pode informar apenas apt as versões a serem instaladas manualmente:

sudo apt install libglib2.0-dev libglib2.0-0=2.48.0-1ubuntu4 libglib2.0-bin=2.48.0-1ubuntu4
    
por Byte Commander 01.06.2017 / 22:40