Find the answer to your Linux question:
Results 1 to 8 of 8
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Error removing courier-imap


    I am trying to remove courier-imap and reinstall courier. However when I run the command apt-get --purge remove courier-imap, I get the error listed below.

    What are my options and what can I do to get courier reinstalled?

    # apt-get --purge remove courier-imap
    Reading package lists... Done
    Building dependency tree... Done
    The following packages will be REMOVED:
    courier-imap*
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    1 not fully installed or removed.
    Need to get 0B of archives.
    After unpacking 1483kB disk space will be freed.
    Do you want to continue [Y/n]? y
    (Reading database ... 33905 files and directories currently installed.)
    Removing courier-imap ...
    ERR: /usr/sbin/couriertcpd missing
    invoke-rc.d: initscript courier-imap, action "stop" failed.
    dpkg: error processing courier-imap (--purge):
    subprocess pre-removal script returned error exit status 1
    ERR: /usr/sbin/couriertcpd missing
    invoke-rc.d: initscript courier-imap, action "start" failed.
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 1
    Errors were encountered while processing:
    courier-imap
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Did you delete any files because the package manager says /usr/sbin/couriertcpd is missing and thats probably why the uninstall script is failing.

  3. #3
    That is exactly the problem. I deleted items without uninstalling this. I made a mistake before verifying the packages were uninstalled.

    How do I correct the issue?

  4. $spacer_open
    $spacer_close
  5. #4
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Try
    Code:
    #dpkg -r --force --purge courier-imap

  6. #5
    I could not use the exact command you gave me, however I tried
    Code:
    dpkg --purge --force-all courier-imap
    and
    Code:
    dpkg --remove --force-all courier-imap
    I still get the same error.

    --------------------Error---------------------
    # dpkg --purge --force-all courier-imap
    (Reading database ... 33905 files and directories currently installed.)
    Removing courier-imap ...
    ERR: /usr/sbin/couriertcpd missing
    invoke-rc.d: initscript courier-imap, action "stop" failed.
    dpkg: error processing courier-imap (--purge):
    subprocess pre-removal script returned error exit status 1
    ERR: /usr/sbin/couriertcpd missing
    invoke-rc.d: initscript courier-imap, action "start" failed.
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 1
    Errors were encountered while processing:
    courier-imap

  7. #6
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Maybe you should download the courier-imap deb and force an installation and then deinstall it afterwards.

  8. #7
    I'll give that a try and report back.

  9. #8
    -->
    I found the solution.

    Hopefully this solution will help for those of you that stumble upon this problem.

    I first edited
    Code:
    vi /var/lib/dpkg/info/courier-imap.postinst
    and I added
    Code:
    exit 1
    to the top of the file.
    What this does, it is tells the some program with apt-get to exit out of the installation script and ignores the info.

    After that, I just ran
    Code:
    apt-get remove --purge courier-imap
    and I just reinstalled it by using
    Code:
    apt-get install courier-imap
    The point of reference for this solution was Forum Ubuntu-fr.org / pb pour deinstaller / reinstaller un logciel

    Worked perfectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •