Não consigo atualizar meu sistema por causa de pacotes quebrados. Eu tenho sido incapaz de resolver este problema há alguns meses e, francamente, estou à beira de fazer uma reinstalação completa do Ubuntu. Este post representa a minha última esperança em encontrar uma solução. Aqui está o que eu tentei:
Informações da versão
$ uname -a && gcc --version
Linux prometheus 3.13.0-87-generic #132-Ubuntu SMP Mon May 16 20:51:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
...
Lista de origens
$ grep -v "^#" /etc/apt/sources.list /ect/apt/sources.list.d/*
deb http://za.archive.ubuntu.com/ubuntu/ trusty main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-security main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-security main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-backports main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-backports main universe multiverse #Added by software-properties
deb http://archive.canonical.com/ trusty partner
deb-src http://archive.canonical.com/ trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner
apt-get stuff
$ sudo apt-get update
...
Não há problemas aí ...
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
gcc-4.9-base libgcc1
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Parece que acabei com várias versões do gcc de alguma forma! Aquele que está sendo mantido pelo gerenciador de pacotes sendo uma versão mais nova.
verificar a tabela de versões revela
$ apt-cache policy gcc-4.9-base libgcc1
gcc-4.9-base:
Installed: 4.9.2-0ubuntu1~12.04
Candidate: 4.9.3-0ubuntu4
Version table:
4.9.3-0ubuntu4 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
*** 4.9.2-0ubuntu1~12.04 0
100 /var/lib/dpkg/status
4.9-20140406-0ubuntu1 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
libgcc1:
Installed: 1:4.9.2-0ubuntu1~12.04
Candidate: 1:4.9.3-0ubuntu4
Version table:
1:4.9.3-0ubuntu4 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
*** 1:4.9.2-0ubuntu1~12.04 0
100 /var/lib/dpkg/status
1:4.9-20140406-0ubuntu1 0
500 http://za.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
Parece que eu estava ansioso ao instalar o gcc 4.9 enquanto ainda estava preciso, e agora acabei nesse estado estranho e confuso. Retrospectivamente, isso pode ter sido uma má ideia. Eu tentei atualizar o gcc via synaptic, mas inevitavelmente quer remover uma lista louca de pacotes (incluindo o apt), o que parece muito indesejável.
Então, minha pergunta é: há esperança de recuperar o sistema e resolver os problemas de dependência?
Atualizar
$ sudo apt-get install --reinstall gcc-4.9-base libgcc1
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:
gvfs : Depends: gvfs-daemons (>= 1.20.3-0ubuntu1.2)
Depends: gvfs-daemons (< 1.20.3-0ubuntu1.2.1~)
indicator-network : Depends: unity8 (>= 7.82) but it is not going to be installed
libegl1-mesa : Depends: libgbm1 (>= 7.11~1) but it is not going to be installed
Recommends: libegl1-mesa-drivers
libgl1-mesa-glx : Depends: libglapi-mesa (= 10.1.3-0ubuntu0.6)
Recommends: libgl1-mesa-dri (>= 7.2)
libqt5gui5 : Depends: libgbm1 (>= 8.1~0) but it is not going to be installed
libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-0ubuntu1~12.04) but 4.9.3-0ubuntu4 is to be installed
libubuntu-application-api-mirserver1 : Depends: libmirserver18 (>= 0.1.8+14.04.20140408.1) but it is not going to be installed
libunity-mir1 : Depends: libmirserver18 (>= 0.1.8+14.04.20140411) but it is not going to be installed
unity-scope-mediascanner2 : Depends: mediascanner2.0 but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Eu também tentei essa correção, sem sucesso:
sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Starting pkgProblemResolver with broken count: 7
Starting 2 pkgProblemResolver with broken count: 7
Investigating (0) libstdc++6 [ amd64 ] < 4.9.2-0ubuntu1~12.04 > ( libs )
Broken libstdc++6:amd64 Depends on gcc-4.9-base [ amd64 ] < 4.9.2-0ubuntu1~12.04 -> 4.9.3-0ubuntu4 > ( libs ) (= 4.9.2-0ubuntu1~12.04)
Considering gcc-4.9-base:amd64 17 as a solution to libstdc++6:amd64 525
Added gcc-4.9-base:amd64 to the remove list
Fixing libstdc++6:amd64 via keep of gcc-4.9-base:amd64
Investigating (0) libgcc1 [ amd64 ] < 1:4.9.2-0ubuntu1~12.04 -> 1:4.9.3-0ubuntu4 > ( libs )
Broken libgcc1:amd64 Depends on gcc-4.9-base [ amd64 ] < 4.9.2-0ubuntu1~12.04 -> 4.9.3-0ubuntu4 > ( libs ) (= 4.9.3-0ubuntu4)
Considering gcc-4.9-base:amd64 17 as a solution to libgcc1:amd64 463
Holding Back libgcc1:amd64 rather than change gcc-4.9-base:amd64
Try to Re-Instate (0) gcc-4.9-base:amd64
Try to Re-Instate (1) libgcc1:amd64
Done
Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages have been kept back:
gcc-4.9-base libgcc1
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Antes de tentar forçar a reinstalação, eu posso tentar reverter para o gcc-4.8 e tentar a atualização novamente ...