Debian Wheezy: reinstalar o apache2

1

O pacote apache2 foi quebrado no meu servidor Debian, então eu iniciei desinstalando todo o pacote relacionado ao apache2. Agora tudo parece estar desinstalado corretamente.

dpkg -l | grep 'apache' não retorna nada

No entanto, parece que não consigo instalar o apache2 ...

com apt-get :

sudo 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+deb7u6) but it is not going to be installed or
                    apache2-mpm-prefork (= 2.2.22-13+deb7u6) but it is not going to be installed or
                    apache2-mpm-event (= 2.2.22-13+deb7u6) but it is not going to be installed or
                    apache2-mpm-itk (= 2.2.22-13+deb7u6) but it is not going to be installed
           Depends: apache2.2-common (= 2.2.22-13+deb7u6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

E com aptitude :

sudo 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+deb7u6) but it is not going to be installed or
                    apache2-mpm-prefork (= 2.2.22-13+deb7u6) but it is not going to be installed or
                    apache2-mpm-event (= 2.2.22-13+deb7u6) but it is not going to be installed or
                    apache2-mpm-itk (= 2.2.22-13+deb7u6) but it is not going to be installed
           Depends: apache2.2-common (= 2.2.22-13+deb7u6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@dora:~# sudo aptitude install apache2
The following NEW packages will be installed:
  apache2 apache2-mpm-worker{a} apache2-utils{a} apache2.2-bin{a} apache2.2-common{a} libaprutil1-dbd-sqlite3{ab} libaprutil1-ldap{ab} 
0 packages upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 1 290 kB of archives. After unpacking 5 146 kB will be used.
The following packages have unmet dependencies:
 libaprutil1-dbd-sqlite3 : Depends: libaprutil1 (= 1.4.1-3) but 1.5.4-1+b1 is installed.
 libaprutil1-ldap : Depends: libaprutil1 (= 1.4.1-3) but 1.5.4-1+b1 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     apache2 [Not Installed]                            
2)     apache2-mpm-worker [Not Installed]                 
3)     apache2.2-bin [Not Installed]                      
4)     apache2.2-common [Not Installed]                   
5)     libaprutil1-dbd-sqlite3 [Not Installed]            
6)     libaprutil1-ldap [Not Installed]                   



Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

Como posso resolver esse problema e fazer o Apache funcionar novamente?

Edite para responder Martin:

cat /etc/apt/sources.list
deb http://debian.mirrors.ovh.net/debian/ wheezy main
deb-src http://debian.mirrors.ovh.net/debian/ wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

deb http://packages.dotdeb.org wheezy all
deb-src http://packages.dotdeb.org wheezy all

deb http://packages.dotdeb.org wheezy-php55 all
deb-src http://packages.dotdeb.org wheezy-php55 all

deb http://security.debian.org/ testing/updates main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main

deb http://repo.mysql.com/apt/debian/ wheezy mysql-5.6
deb-src http://repo.mysql.com/apt/debian/ wheezy mysql-5.6

deb http://dl.google.com/linux/mod-pagespeed/deb/ stable main

E finalmente:

apt-cache policy libaprutil1
libaprutil1:
  Installed: 1.5.4-1+b1
  Candidate: 1.5.4-1+b1
  Version table:
 *** 1.5.4-1+b1 100
        100 /var/lib/dpkg/status
     1.4.1-3 500
        500 http://debian.mirrors.ovh.net/debian wheezy/main amd64 Packages
    
por fkoessler 16.06.2016 / 18:48

2 respostas

3

De acordo com aptitude , uma dependência do Apache chamada libaprutil1 é instalada em uma versão mais recente do que a disponível nos repositórios:

The following packages have unmet dependencies: 
libaprutil1-dbd-sqlite3 : Depends: libaprutil1 (= 1.4.1-3) but
1.5.4-1+b1 is installed.  libaprutil1-ldap : Depends: libaprutil1 (= 1.4.1-3) but 1.5.4-1+b1 is installed.

Você pode tentar descobrir a origem desse pacote com apt-cache policy :

apt-cache policy libaprutil1

libaprutil1=1.5.4-1+b1 parece vir do sid do Debian ... você por acaso tentou instalar o Apache dos repositórios sid? Isso não parece ser uma boa idéia ... se você quiser uma versão mais recente do Apache, eu recomendaria a upgrade para o Debian jessie .

Por favor, anexe a saída de apt-cache policy à sua pergunta (e enquanto você está nisso, também a saída de cat /etc/apt/sources.list ); É possível que seu sources.list contenha URLs dos repositórios wheezy e sid, o que seria uma coisa ruim.

Você pode tentar remover o pacote libaprutil1 mais recente:

aptitude purge libaprutil1

E tente instalar o Apache novamente:

aptitude install apache2
    
por 16.06.2016 / 19:06
3

libaprutil1 é o pacote que está causando problemas (e provavelmente sua dependência, libapr1 ). Você precisa:

  • remova a linha testing/security do seu /etc/apt/sources.list ;
  • atualize os caches de pacotes:

    sudo apt-get update
    
  • remova libaprutil1 e libapr1 :

    sudo aptitude remove libaprutil1 libapr1
    

    (e qualquer pacote que dependa deles)

  • em seguida, instale apache2 :

    sudo aptitude install apache2
    
por 16.06.2016 / 20:12