1

I have this weird issue: apt-get or aptitude are not able to install postfix. each time I get this error:

# apt-get install postfix
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:
 postfix : Depends: libsasl2-2 but it is not going to be installed
E: Broken packages

and

# aptitude install postfix
The following NEW packages will be installed:
  postfix ssl-cert{a} 
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,417 kB of archives. After unpacking 3,535 kB will be used.
The following packages have unmet dependencies:
  exim4-config: Conflicts: postfix but 2.7.1-1+squeeze1 is to be installed.
  libsasl2-2: Breaks: postfix (<= 2.8.3-1) but 2.7.1-1+squeeze1 is to be installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     postfix [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.

/etc/apt/sources.list:

# deb http://ftp.de.debian.org/debian/ squeeze main

deb http://ftp.de.debian.org/debian/ squeeze main
deb-src http://ftp.de.debian.org/debian/ squeeze main

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

# squeeze-updates, previously known as 'volatile'
deb http://ftp.de.debian.org/debian/ squeeze-updates main
deb-src http://ftp.de.debian.org/debian/ squeeze-updates main



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


# MariaDB 10.0 repository list - created 2013-10-11 09:14 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mirror.netcologne.de/mariadb/repo/10.0/debian squeeze main
deb-src http://mirror.netcologne.de/mariadb/repo/10.0/debian squeeze main

I tried to --purge remove both potfix and exim5, and reinstall but the problem still persists. Appreciate your tips.

alfish
  • 3,027
  • 15
  • 45
  • 68

1 Answers1

2

On Debian having an MTA is required by a large number of packages. Trying to purge exim, or any of the other MTAs will result in an alternative being installed. The order of the alternatives is such that removing exim will result in an alternate version of exim being installed or another MTA. These requirements, alternatives, and conflicts make changing your installed MTA a bit tricky. Since simply purging the MTA is not easy, and if you really did try to purge your MTA, you would have to also install almost everything that could use an MTA.

To deal with this MTA weirdness my solution is to install SSMTP.

The SSMTP package, which is a light-weight no-daemon outgoing only MTA that will fulfill the MTA requirement, and doesn't conflict with other MTA. So you can install SSMTP at the same time as every other MTA in the standard repo. Once it is installed, you can purge exim, or other MTAs, and change things around how you like. SSMTP will fill the MTA requirement, and not cause APT to do confusing things to try and make sure you have a MTA installed.

Zoredache
  • 128,755
  • 40
  • 271
  • 413