Debian – Error after trying to install php5-mcrypt on Debian Squeeze

aptdebiandebian-squeezephp-mcryptphp5

I want to install php5-mcrypt, but I get this error after entering a

apt-get install php5-mcrypt

Error:

php5-mcrypt : Hängt ab von: php5-common (= 5.3.3-7+squeeze15) aber 5.3.9-1~dotdeb.2 soll installiert werden

Error (translated):

php5-mcrypt : Depends on: php5-common (= 5.3.3-7+squeeze15) but 5.3.9-1~dotdeb.2 should be installed

My sources.list:

# squeeze packages
deb http://ftp.de.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.de.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

Best Answer

It seems you had different repository sources in the past and you tried to install from them:

  • the official Debian repository
  • the unofficial dotdeb.org repository

The php5-common package coming from dotdeb.org is currently marked to be installed, although you don't have the dotdeb.org source present anymore. And the php5-mcrypt package you're trying to install is coming from the official Debian repository and is from an older version, hence the discrepancy.

To solve that, you have 2 options:

  1. You go with the dotdeb.org repository and you add it back to your sources, you apt-get update and you try to install again.
  2. You keep only packages coming from the official Debian repo, so you should prevent the installation of the php5-common (and any other package coming from dotdeb.org or other unofficial repo and marked to be installed). This can be done with apt-get remove php5-common