Problema de dependência - mas as dependências estão instaladas?

0

Eu estava tentando instalar um pacote que parecia estar quebrado - mysql-server para ser preciso. Seguindo o conselho da Internet, executei apt-get -f install para corrigir dependências, o que gerou uma lista de alterações.

Aceitei essas alterações sem olhar para elas. Aparentemente, essas mudanças foram para remover muitos pacotes importantes -

Log started: 2017-12-21  12:41:04
(Reading database ... 111077 files and directories currently installed.)
Removing php5 (5.6.30+dfsg-0+deb8u1) ...
Removing libapache2-mod-php5 (5.6.30+dfsg-0+deb8u1) ...
php5_invoke prerm: Disable module pdo for apache2 SAPI
php5_invoke prerm: Disable module opcache for apache2 SAPI
php5_invoke prerm: Disable module readline for apache2 SAPI
php5_invoke prerm: Disable module json for apache2 SAPI
Module php5 disabled.
apache2_invoke prerm: Disable module php5
Removing apache2 (2.4.10-10+deb8u9) ...
Removing apache2-bin (2.4.10-10+deb8u9) ...
Removing node (0.3.2-7.4) ...
Removing ax25-node (0.3.2-7.4) ...
Removing build-essential (11.7) ...
Removing dpkg-dev (1.17.27) ...
Removing git (1:2.1.4-2.1+deb8u3) ...
Removing i2c-tools (3.1.1+svn-2) ...
Removing libsoftware-license-perl (0.103010-3) ...
Removing libdata-section-perl (0.200006-1) ...
Removing libmro-compat-perl (0.12-1) ...
Removing libclass-c3-perl (0.26-1) ...
Removing libalgorithm-c3-perl (0.09-1) ...
Removing libalgorithm-diff-xs-perl (0.04-3+b1) ...
Removing libalgorithm-merge-perl (0.08-2) ...
Removing libalgorithm-diff-perl (1.19.02-3) ...
Removing libarchive-extract-perl (0.72-1) ...
Removing libcgi-fast-perl (1:2.04-1) ...
Removing libcgi-pm-perl (4.09-1) ...
Removing libclass-c3-xs-perl (0.13-2+b1) ...
Removing libmodule-build-perl (0.421000-2+deb8u1) ...
Removing 'diversion of /usr/bin/config_data to /usr/bin/config_data.diverted by libmodule-build-perl'
Removing 'diversion of /usr/share/man/man1/config_data.1.gz to /usr/share/man/man1/config_data.diverted.1.gz by libmodule-build-perl'
Removing libcpan-meta-perl (2.142690-1) ...
Removing libsub-exporter-perl (0.986-1) ...
Removing libdata-optlist-perl (0.109-1) ...
Removing libdpkg-perl (1.17.27) ...
Removing liberror-perl (0.17-1.1) ...
Removing libfcgi-perl (0.77-1+deb8u1) ...
Removing openbsd-inetd (0.20091229-2) ...
Removing update-inetd (4.43) ...
Removing libfile-copy-recursive-perl (0.38-1) ...
Removing libfile-fcntllock-perl (0.22-1+b1) ...
Removing libterm-ui-perl (0.42-1) ...
Removing liblog-message-simple-perl (0.10-2) ...
Removing liblog-message-perl (0.8-1) ...
Removing libmodule-pluggable-perl (5.1-1) ...
Removing libmodule-signature-perl (0.73-1+deb8u2) ...
Removing libpackage-constants-perl (0.04-1) ...
Removing libparams-util-perl (1.07-2+b1) ...
Removing php5-readline (5.6.30+dfsg-0+deb8u1) ...
php5_invoke prerm: Disable module readline for cli SAPI
Removing php5-cli (5.6.30+dfsg-0+deb8u1) ...
php5_invoke prerm: Disable module pdo for cli SAPI
php5_invoke prerm: Disable module opcache for cli SAPI
php5_invoke prerm: Disable module json for cli SAPI
Removing php5-json (1.3.6-1) ...
Removing php5-common (5.6.30+dfsg-0+deb8u1) ...
Removing lsof (4.86+dfsg-1) ...
Removing libperl4-corelibs-perl (0.003-1) ...
Removing libpod-latex-perl (0.61-1) ...
Removing 'diversion of /usr/bin/pod2latex to /usr/bin/pod2latex.bundled by libpod-latex-perl'
Removing 'diversion of /usr/share/man/man1/pod2latex.1.gz to /usr/share/man/man1/pod2latex.bundled.1.gz by libpod-latex-perl'
Removing libpod-readme-perl (0.11-1) ...
Removing libregexp-common-perl (2013031301-1) ...
Removing libsub-install-perl (0.928-1) ...
Removing libtext-soundex-perl (3.4-1+b2) ...
Removing libtext-template-perl (1.46-1) ...
Removing libtimedate-perl (2.3000-2) ...
Removing rename (0.20-3) ...
Removing xml-core (0.13+nmu2) ...
Removing sgml-base (1.26+nmu4) ...

Desde então, tenho tentado reinstalar esses pacotes. Isso resulta em uma situação bizarra, no entanto ... isso é o que acontece quando tento instalar o apache2 , por exemplo:

root@srv2:/# apt-get install apache2
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:
 apache2 : Depends: apache2-mpm-worker (= 2.2.22-13+deb7u12) but it is not going to be installed or
                    apache2-mpm-prefork (= 2.2.22-13+deb7u12) but it is not going to be installed or
                    apache2-mpm-event (= 2.2.22-13+deb7u12) but it is not going to be installed or
                    apache2-mpm-itk (= 2.2.22-13+deb7u12) but it is not going to be installed
           Depends: apache2.2-common (= 2.2.22-13+deb7u12) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Está bem ... tentar instalá-los manualmente, por exemplo, apache2.2-common :

root@srv2:/# apt-get install apache2.2-common
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:
 apache2.2-common : Depends: apache2.2-bin (= 2.2.22-13+deb7u12) but it is not going to be installed
                    Depends: perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

"Depende: perl" é um problema que muitos pacotes parecem estar relatando. No entanto, parece estar bem instalado ...

root@srv2:/# perl -v

This is perl 5, version 20, subversion 2 (v5.20.2) built for arm-linux-gnueabihf-thread-multi-64int

(com 95 patches registrados, veja perl -V para mais detalhes)

Para o apt, ele não parece estar instalado:

root@srv2:/# apt-get install perl
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:
 adduser : Depends: perl-base (>= 5.6.0) but it is not going to be installed
           Depends: passwd (>= 1:4.0.12) but it is not going to be installed
           Depends: debconf but it is not going to be installed or
                    debconf-2.0
 libfontconfig1 : Depends: fontconfig-config (>= 2.11.0-6.3+deb8u1) but it is not going to be installed
 libpython3-stdlib : Depends: libpython3.4-stdlib (>= 3.4.2-0) but it is not going to be installed
 libxt6 : Depends: libsm6 but it is not going to be installed
 logrotate : Depends: cron or
                      anacron but it is not going to be installed or
                      cron-daemon
             Recommends: mailx
 perl : Depends: perl-base (= 5.14.2-21+rpi2+deb7u2) but it is not going to be installed
        Depends: perl-modules (>= 5.14.2-21+rpi2+deb7u2) but it is not going to be installed
 python : Depends: python2.7 (>= 2.7.9-1~) but it is not going to be installed
          Depends: libpython-stdlib (= 2.7.9-1) but it is not going to be installed
 python3-minimal : Depends: python3.4-minimal (>= 3.4.2-0) but it is not going to be installed
 python3-venv : Depends: python3.4-venv (>= 3.4.2-0) but it is not going to be installed
 python3.4 : Depends: python3.4-minimal (= 3.4.2-1) but it is not going to be installed
             Depends: libpython3.4-stdlib (= 3.4.2-1) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Esses pacotes são literalmente instalados e o apt sabe disso. O pacote adduser está literalmente instalado no servidor e, no entanto, está relatando isso como uma dependência não atendida. Com esses problemas, não consigo nem começar a reparar os pacotes excluídos.

Mais informações:

root@srv2:/# apt-get install adduser
Reading package lists... Done
Building dependency tree       
Reading state information... Done
adduser is already the newest version.

root@srv2:/# apt-mark showhold
root@srv2:/# apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
  -1 http://archive.raspberrypi.org/debian/ jessie/ui armhf Packages
     release o=Raspberry Pi Foundation,a=oldstable,n=jessie,l=Raspberry Pi Foundation,c=ui
     origin archive.raspberrypi.org
  -1 http://archive.raspberrypi.org/debian/ jessie/main armhf Packages
     release o=Raspberry Pi Foundation,a=oldstable,n=jessie,l=Raspberry Pi Foundation,c=main
     origin archive.raspberrypi.org
 989 http://archive.raspbian.org/raspbian/ wheezy/non-free armhf Packages
     release v=7.0,o=Raspbian,a=oldoldstable,n=wheezy,l=Raspbian,c=non-free
     origin archive.raspbian.org
 989 http://archive.raspbian.org/raspbian/ wheezy/contrib armhf Packages
     release v=7.0,o=Raspbian,a=oldoldstable,n=wheezy,l=Raspbian,c=contrib
     origin archive.raspbian.org
 989 http://archive.raspbian.org/raspbian/ wheezy/main armhf Packages
     release v=7.0,o=Raspbian,a=oldoldstable,n=wheezy,l=Raspbian,c=main
     origin archive.raspbian.org
Pinned packages:
    
por Joseph A. 21.12.2017 / 09:04

1 resposta

1

Alguns de seus pacotes são instalados a partir de Jessie Raspbian, mas suas prioridades de pin (em /etc/apt/preferences ) favorecem Raspbian Wheezy e impedem a instalação de novos pacotes de Jessie (que é a prioridade -1). Como resultado, os pacotes removidos não podem ser reinstalados, pois isso exigiria pacotes do Jessie, que são excluídos.

Para corrigir isso, você precisa:

  1. tente descobrir por que Jessie está listada, mas marcada com -1;
  2. se não houver um bom motivo para o PIN, edite /etc/apt/preferences para removê-lo;
  3. restaure os pacotes removidos.

Você provavelmente também desejará fazer o upgrade completo para Jessie em algum momento, usando apt dist-upgrade (mas, desta vez, tome cuidado com as remoções de pacotes - se houver muitas, investigue antes de confirmar).

    
por 21.12.2017 / 09:59

Tags