Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to replace postfix with exim4 on my Ubuntu test server to reflect the setup I have on my production server, but apt-get and aptitude (quite understandably) insist on removing several packages that depend upon having a mail stack. However, in this case I am prepared to override apt-get's undoubted good sense as exim should fulfil all the requirements of the dependent packages, providing mail and sendmail functionality for my applications. I don't want to remove the dependent packages as there is months of effort invested and, although backed up, will be a pain to reconstruct properly.

share|improve this question
Do the dependent packages want postfix specifically, or the mail-transport-agent virtual package (which exim provides)? –  Shane Madden Apr 14 '12 at 0:14
Shane. Yes, they are dependent upon mail-transport-agent (and default-mta) but .... when I try aptitude install exim4 it seems that exim4 will satisfy the dependencies. –  iainH Apr 14 '12 at 11:03
I eventually solved this. Please see my answer. –  iainH Apr 14 '12 at 11:44
add comment

2 Answers

up vote 2 down vote accepted

I have managed to install exim4 in place of postfix. I did:

    dpkg --force-all -r postfix
    apt-get purge postfix

I ignored the advice to apt-get -f install as it attempted to re-install postfix. Then:

    aptitude install exim4-daemon-heavy sa-exim

Now I can get on with configuring my test server's MTA like my production one.

share|improve this answer
add comment

Normally, you just ask aptitude to install new mail server:

   aptitude installl exim4

Here how it looks for me:

datacompboy@nuuzerpogodible:~$ LANG=C sudo aptitude install postfix
The following NEW packages will be installed:
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1565 kB of archives. After unpacking 3479 kB will be used.
The following packages have unmet dependencies:
 postfix : Conflicts: mail-transport-agent which is a virtual package.
 exim4-daemon-light : Conflicts: mail-transport-agent which is a virtual package.
 exim4-config : Conflicts: postfix but 2.9.1-2 is to be installed.
The following actions will resolve these dependencies:

     Remove the following packages:
1)     exim4                       
2)     exim4-base                  
3)     exim4-config                
4)     exim4-daemon-light          

Accept this solution? [Y/n/q/?] y
The following NEW packages will be installed:
The following packages will be REMOVED:
  exim4{a} exim4-base{a} exim4-config{a} exim4-daemon-light{a} 
0 packages upgraded, 1 newly installed, 4 to remove and 0 not upgraded.
Need to get 1565 kB of archives. After unpacking 417 kB will be freed.

This is correct behaviour: only one MTA can live in system without PITA

If it tries to remove more packages, than you want, you should check with

aptitude why somepackage

to get info about why package get installed. Now, you should decide. If remove policy is {a} -- this means that package installed due to automatic dependencies, you can remove fact that it installed automatically and set it to manual with

aptitude unmarkauto somepackage

After that, somepackage will be threated as manually installed, and it will be removed only in case of conflicts, not because it not used anymore.

share|improve this answer
Thanks @datacompboy. The problems that aptitude says it'll do the right thing: replace postfix with exim4. And this should be transparent to all the programs / packages that require mail. However, aptitude fails to complete the "swop-over" with E: Could not perform immediate configuration on 'exim4-daemon-light'. So this is actually the real problem I have. Right now I can't see a way around it without editing apt.conf which is not my preferred path! –  iainH Apr 14 '12 at 10:56
I eventually solved this. Please see my answer above. –  iainH Apr 14 '12 at 11:43
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.