Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a server, 8.04, which i've been toying with Postfix, installing and removing with purge option. The thing is, i wanna reinstall it (so it shows the config menu) but Aptitude and apt keep telling that it's already installed.

I removed and purged several times, even manually deleted some files the purge left, and no luck.

So, is there a way to manually remove the entry or something else, so Aptitude installs it normally?

Thanks!!

share|improve this question
    
It would be helpful if you post the output from the aptitude purge command, and "dpkg -l postfix". –  jtimberman Aug 25 '09 at 17:14
    
Please change the title to something more meaningful. –  nagul Aug 25 '09 at 17:51
    
Done, hope you like it! –  Gabriel A. Zorrilla Aug 25 '09 at 18:56

3 Answers 3

up vote 1 down vote accepted

Warning: Do not try this unless you have exhausted all other avenues.

Since apt-get, aptitude etc all internally use the dpkg command, we are going to remove all traces of the package installation from the dpkg database, and con dpkg, apt-get, aptitude etc into thinking the package was never installed.

  • The dpkg database is the /var/lib/dpkg/status file. Take a backup of this file. We are going to be messing about with the guts of the dpkg system, and you need the original file in case this procedure goes belly up.
  • Edit the status file:

    sudo gedit /var/lib/dpkg/status

  • Locate the entry for the postfix package in this file. Each package will typically have an entry like shown below. Delete the whole entry. Note: There should be no packages that depend on this package. If there are, you should remove those packages first, so when you open this file, the package is referenced in only one block, which you will then proceed to remove.

    Package: autokey
    Status: install ok installed
    Priority: optional
    Section: kde
    Installed-Size: 456
    Maintainer: Chris Dekter cdekter@gmail.com
    Architecture: all
    Version: 0.60.4-0~jaunty
    Depends: python (>= 2.6), python-central (>= 0.6.11), python-kde4, python-qt4, python-qscintilla2, python-xlib
    Conffiles:
    /etc/init.d/autokey 1f0e894e58a6ff428e3a892c27caf300
    Description: Desktop automation utility
    AutoKey is a desktop automation utility for Linux and X11. It allows the
    automation of virtually any task by responding to typed abbreviations and
    hotkeys. It offers a full-featured GUI that makes it highly accessible for
    novices, as well as a scripting interface offering the full flexibility and
    power of the Python language.
    Homepage: http://autokey.googlecode.com/
    Python-Version: >= 2.6

  • Save the file.

  • Reboot. There may be cached versions of the file, so a reboot is necessary to ensure everyone reads from this new file.
  • Re-install the package.

The only reason I post these instructions is that I had a similar issue recently: The autokey package was in a horribly messed up state (the disk got full in the middle of an install, and entries that should have been written were not), and I finally had to resort to the above steps to reinstall the package. It worked for me, and it should work for you, but you use these instructions at your own risk.

Edit: I should also let you know I used apt-get for the (failed) install and the re-install.

share|improve this answer
1  
Worked. I deleted the entry regardless some calls from other packages. I'll see how this action's repercussion, but managed to install it back! –  Gabriel A. Zorrilla Aug 25 '09 at 21:13

Your package is in an inconsistent state. You may need to reinstall it (aptitude install postfix). And possibly reconfigure it (dpkg-reconfigure postfix).

share|improve this answer
    
This did not work, that was the whole point of this topic. Thanks anyway! –  Gabriel A. Zorrilla Aug 26 '09 at 16:01

You claim to have used both Aptitude and apt, I'm just hoping you haven't tried to install with Aptitude and remove with apt or vice versa, because that's a big no no. You can try

aptitude hold postfix

which should fix the package in it's current state. Then try a purge. Alternatively try to install over it:

aptitude install postfix

then purge.

share|improve this answer
    
Why is that a no-no? They both use the same database, and probably share a substantial amount of code. –  JesperE Aug 25 '09 at 18:25
    
It mostly has to do with removing packages, there is frequently differences between what each package manager views as "orphaned dependencies". –  John T Aug 25 '09 at 18:33
    
Please check the output when trying to install postfix, after doing the hold thingie: pastebin.com/f69695192 –  Gabriel A. Zorrilla Aug 25 '09 at 19:06

Your Answer

 
discard

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.