LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-15-2006, 06:07 AM   #1
PlymWS
Member
 
Registered: Aug 2006
Posts: 51

Rep: Reputation: 16
Need to repair broken Postfix installation


I have done something while trying to install a mail server. Something has happened to Postfix so that if I try and remove it or upgrade it I get the following message :

Code:
 dpkg: error processing postfix (--remove):
 subprocess pre-removal script returned error exit status 1
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
How would I go about repairing this problem so I can have another go at installing the mail server ? Also, if there's any simple guides to follow, a link would be much appreciated.

Last edited by PlymWS; 09-15-2006 at 11:43 AM.
 
Old 09-15-2006, 07:26 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
your system always requires an mtu to run - even if it is only for local mail delivery.
if you install exim, postfix will automatically be removed (note: not purged)
once exim is running you can purge postfix
dpkg --purge postfix
and then install it again

though best would be to simply reconfigure it:
dpkg --reconfigure postfix
that should do a good job if it as the above is a really messy workaround and i kind of feel ashamed to have ever written it :-P
 
Old 09-15-2006, 10:18 AM   #3
PlymWS
Member
 
Registered: Aug 2006
Posts: 51

Original Poster
Rep: Reputation: 16
OK, when I try to reconfigure it it says that postfix isn't running so I run /etc/init.d/postfix start and get a message saying that postfix is running. When I dpkg-reconfigure postfix it says that postfix isn't running ???

I've tried everything I can find on google but it seems that the pre-removal script is failing because postfix isn't running. Even if I run postfix it doesn't run as I try and stop it immediately afetr running it and the message reports that postfix isn't running.

I've downloaded the .deb and dpkg -i postfix.deb to reinstall the program, but it still doesn't work. I can't update the program as it's the latest version (stable) and I can't uninstall it because of the pre-removal script.

Is there anything I can do or am I stuck like this now ?

Last edited by PlymWS; 09-15-2006 at 11:19 AM.
 
Old 09-16-2006, 05:31 AM   #4
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
- try purging postfix
- try renaming the postfix init script to start with a 'K' in /etc/rc[0-6].d/
- try forcing (--force of -f) when reinstalling or when installing exim4
- also try forcing when purging
- if dpkg --purge postfix does not work - check dpgk --list | grep postfix to see all postfix package mages
- run apt-get check (this checks for brocken dependancies)

that should give you some to do right now :-)
 
Old 09-16-2006, 05:45 AM   #5
PlymWS
Member
 
Registered: Aug 2006
Posts: 51

Original Poster
Rep: Reputation: 16
I tried most of that already

I hadn't tried dpkg --force to try and remove the package but when I try that I still get the error message

Code:
(Reading database ... 86371 files and directories currently installed.)
Removing postfix ...
postfix/postfix-script: fatal: the Postfix mail system is not running
dpkg: error processing postfix (--remove):
 subprocess pre-removal script returned error exit status 1
Errors were encountered while processing:
 postfix
I can't seem to do anything with postfix because it's broken somehow but I can't find out what's broken to fix it and I can't install any other software because it tries to uninstall postfix, which obviously fails.
 
Old 09-16-2006, 01:52 PM   #6
kmoffat
Member
 
Registered: Jul 2003
Location: near Seattle
Distribution: Debian/Ubuntu/Suse
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
Check that /var/lib/dpkg/info/postfix.prerm is there and contains the "remove)" lines. Try hashing "#" the /etc/init.d/postfix stop line, then make sure postfix is not running and try the removal again.
 
Old 09-17-2006, 07:46 AM   #7
PlymWS
Member
 
Registered: Aug 2006
Posts: 51

Original Poster
Rep: Reputation: 16
That's it

I had to comment the line in the prerm script that tried to stop postfix. Without that command the uninstall script worked fine and I was able to install another package to test it had worked (Exim4).

Many thanks for all your help.
 
Old 10-15-2019, 09:03 AM   #8
Milyoz
LQ Newbie
 
Registered: Oct 2019
Posts: 1

Rep: Reputation: Disabled
other solution

Edit from 2019

I'd the same problem during a school project. Teacher & me found this solution: to delete postfix entries in var\lib\dpkg\status. Update, Upgrade and install.

This solution could be effective for others packages with the same problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SuSe 9.0 Repair Installation PlantPerson SUSE / openSUSE 4 07-02-2005 11:01 AM
Postfix Installation dwpondscum Linux - Newbie 1 12-02-2004 05:32 PM
Using the installation CD to boot and repair the MBR in Mandrake 10 dvela Mandriva 5 08-19-2004 09:17 AM
I think I need a repair installation Teckno Linux - General 12 06-16-2004 06:43 PM
installation repair? ray318 Linux - Software 1 04-22-2002 10:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration