How to solve upgrade problems?

Discussion in 'ISPConfig 3 Priority Support' started by MaxT, Apr 8, 2019.

  1. MaxT

    MaxT Active Member

    I have this problem when trying to upgrade the system and then starts Dovecot. The process ask me about preserving my config file; I answer "YES" and then it breaks.

    I know this is not a new problem but I don't know the right way to solve this for ISPC. I have found comments of people recommending a new Dovecot install, although I have clamav disabled and some modifications in headers, etc.. I'm not sure on this.

    What's the best way to solve this problem?

    Code:
    # apt-get upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    8 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n]
    Setting up dovecot-core (1:2.2.27-3+deb9u4) ...
    ucfr: Attempt from package dovecot-core  to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core
    ucfr: Aborting.
    dpkg: error processing package dovecot-core (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-lmtpd:
     dovecot-lmtpd depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-lmtpd (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-mysql:
     dovecot-mysql depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Run an ispconfig update after system upgrade and choose to reconfigure services during ispconfig update.
     
  3. MaxT

    MaxT Active Member

    I made a system upgrade with result of a kernel upgrade. I rebooted the system, and #apt-get ugrade, and it only show several retained packages:
    Code:
      icu-devtools libapache2-mod-php libapache2-mod-php7.0 libicu-dev php-mysql php-xml php7.0-cgi php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-imap php7.0-intl php7.0-json php7.0-mbstring php7.0-mcrypt
      php7.0-mysql php7.0-opcache php7.0-pspell php7.0-readline php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-zip
      
    then I do #ispconfig_update.sh and it show me "there are no updates available".

    Then I do #dpkg -s dovecot-core, and I can see "Version: 1:2.2.27-3+deb9u4". Therefore the new Dovecot now seems to be installed and without the previous complaints. I cannot understand why now it is installed without warnings about my local dovecot config. The dovecot.conf file still is the same one.

    I doubt if these php retained packages exists because my php5.6 and php7.0 were installed using the sury repositories (in order to have the mysql support for an old site). I'm not sure of doing an #aptitude full-upgrade, because I fear possible conflicts with these outer php versions, or loosing all the php configuration in the server.

    I would be grateful to know any recommendation about upgrading or just keeping these packages retained, or any other solution!
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The Debian 'apt-get update && apt-get upgrade' is the normal update procedure, it's not a dist upgrade to move to a new major Debian version. I use apt-get upgrade daily on my Debian servers and nothing ever breaks. An ISPConfig update is also necessary only on a dist upgrade (when you switch sources.list to a newer Debian release and then run apt-get dit-upgrade.

    So my question is now, what did you do (a system update or a distribution upgrade)? Did you change sources.lit to a newer Debian version (e.g. debian 8 to 9) or did you just install the regular updates with 'apt-get upgrade' command as one would do normally on a daily basis?
    A 'apt-get upgrade' run also does not alter dovecot.conf file, so I have no idea how dovecot can break when you just install regular updates.

    Regarding ispconfig update, instructions on how to force an ispconfig update as necessary after a distribution upgrade can be found in the release notes of every ispconfig release, e.g.: https://www.ispconfig.org/blog/ispconfig-3-1-13p1-released/
     
  5. MaxT

    MaxT Active Member

    sorry, I said "upgrade" for the #apt-get upgrade. No upgrade of the distro version. Only I try to do a common update using #apt-get upgrade

    and it show me these retained packages:

    Code:
      icu-devtools libapache2-mod-php libapache2-mod-php7.0 libicu-dev php-mysql php-xml php7.0-cgi php7.0-cli
      php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-imap php7.0-intl php7.0-json php7.0-mbstring
      php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-pspell php7.0-readline php7.0-recode php7.0-sqlite3
      php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-zip
    my repos are : "debian stretch main contrib non-free "
    and also I have the Sury repos for php: deb https://packages.sury.org/php/ stretch main

    An #ispconfig_update.sh show: "There are no updates available for ISPConfig 3.1.13p1"

    Now the previous dovecot complaints are missed, and maybe now there is not need of an ISPC udpate .

    Main problem is, I don't know what to do with these retained packages. I dont know if it can cause conflicts with the php configuration of the server because I installed php with Sury repos. I don't know if the retained packages (I suppose they come from debian repos) would break the php configuration of ISPC.
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What are retained packages? Do you mean packages on hold? Or not yet upgraded packages?
    Show complete results of following command including the command you issue.
    Code:
    LANG=C apt-get upgrade
    If the list of packages you pasted is from command apt-get upgrade, then my guess is those packages have not been upgraded yet because upgrading would remove or add some other packages. If my quess is correct, you can fix the issue with command
    Code:
    apt-get dist-upgrade
    which can do the removals of packages and installations of not yet installed packages. This situation is because you have additional package repositories from outside of Debian Project, and those sometimes add, rename or remove packages. Debian project does this only when a new version is released.
     
    MaxT likes this.
  7. MaxT

    MaxT Active Member

    yes, I have applied the #apt-get dist-upgrade and it seems all works well. New packages were from Sury repos instead Debian as I thought.

    The main change is a new php7.3 replace the default php7.0 and it is applied to websites. Then I should re-configure the new php.ini again to configure disabled_functions and these things.

    Anyway, I think I will avoid future php updates. I've done
    Code:
    #echo php7.3-common hold | dpkg --set-selections
    to avoid updates.
    This command is enough, I hope


    lot of thanks! :)
     
    Last edited: Apr 10, 2019
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    MaxT likes this.
  9. MaxT

    MaxT Active Member

    thanks till, I have applied that and the php 7.0 returns.

    Although I'm with a new vps in a new installation, and the first error of this thread appears again:

    Code:
    # apt-get upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    8 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n]
    Setting up dovecot-core (1:2.2.27-3+deb9u4) ...
    ucfr: Attempt from package dovecot-core  to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core
    ucfr: Aborting.
    dpkg: error processing package dovecot-core (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-lmtpd:
     dovecot-lmtpd depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-lmtpd (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-mysql:
     dovecot-mysql depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-mysql (--configure):
     dependency problems - leaving unconfigured
    Setting up rkhunter (1.4.2-6+deb9u1) ...
    ucfr: Attempt from package rkhunter  to take /etc/default/rkhunter away from package 3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:rkhunter
    ucfr: Aborting.
    dpkg: error processing package rkhunter (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-sieve:
     dovecot-sieve depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-sieve (--configure):
     dependency problems - leaving unconfigured
    Setting up openssh-server (1:7.4p1-10+deb9u6) ...
    ucfr: Attempt from package openssh-server  to take /etc/ssh/sshd_config away from package 1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:openssh-server
    ucfr: Aborting.
    dpkg: error processing package openssh-server (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-pop3d:
     dovecot-pop3d depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-pop3d (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-imapd:
     dovecot-imapd depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-imapd (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     dovecot-core
     dovecot-lmtpd
     dovecot-mysql
     rkhunter
     dovecot-sieve
     openssh-server
     dovecot-pop3d
     dovecot-imapd
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    It happens after I answered "YES" to preserve my local config. And then, the next #apt-get upgrade shows this.

    # ispconfig_update.sh show "There are no updates available for ISPConfig 3.1.13p1"

    I have tried a reboot, although different of previous case, here the error persist.
    My repos are
    #deb http://deb.debian.org/debian stretch main contrib non-free
    #deb-src http://deb.debian.org/debian stretch main contrib non-free

    I can find in Google other people with this problem but from some years ago, and about solving this problem reinstalling Dovecot.
    Is there a more soft solution?. It seems like Dovecot cannot catch the previous .conf file or something like that...
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Choose to overwrite config during dovecot update and then do an ispconfig update with reconfigure services = yes. Please see #4 in this thread, I posted a link there on how to force an ispconfig update to reconfigure services.
     
  11. MaxT

    MaxT Active Member

    I do that but it doesn't work:

    Code:
    # cd ispconfig3_install/install
    # php -q update.php
    
    
    --------------------------------------------------------------------------------
     _____ ___________   _____              __ _         ____
    |_   _/  ___| ___ \ /  __ \            / _(_)       /__  \
      | | \ `--.| |_/ / | /  \/ ___  _ __ | |_ _  __ _    _/ /
      | |  `--. \  __/  | |    / _ \| '_ \|  _| |/ _` |  |_ |
     _| |_/\__/ / |     | \__/\ (_) | | | | | | | (_| | ___\ \
     \___/\____/\_|      \____/\___/|_| |_|_| |_|\__, | \____/
                                                  __/ |
                                                 |___/
    --------------------------------------------------------------------------------
    
    
    >> Update
    
    Operating System: Debian 9.0 (Stretch) or compatible
    
    This application will update ISPConfig 3 on your server.
    
    Shall the script create a ISPConfig backup in /var/backup/ now? (yes,no) [yes]:
    
    Creating backup of "/usr/local/ispconfig" directory...
    Creating backup of "/etc" directory...
    Checking ISPConfig database .. OK
    Starting incremental database update.
    Loading SQL patch file: /tmp/ispconfig3_install/install/sql/incremental/upd_dev_collection.sql
    Reconfigure Permissions in master database? (yes,no) [no]:
    
    Service 'dns_server' has been detected (currently disabled) do you want to enable and configure it?  (yes,no) [no]:
    
    Service 'web_server' has been detected (currently disabled) do you want to enable and configure it?  (yes,no) [no]:
    
    WARNING: If ISPConfig-Interface (Webfrontend) is installed on this Server we will configure the Web Server anyways but will not enable it in ISPConfig.
    
    Service 'firewall_server' has been detected (currently disabled) do you want to enable and configure it?  (yes,no) [no]:
    
    Reconfigure Services? (yes,no,selected) [yes]:
    
    Configuring Postfix
    Configuring Dovecot
    Configuring Mailman
    Configuring Spamassassin
    Configuring Amavisd
    Configuring Getmail
    Configuring Pureftpd
    Configuring Apache
    Configuring vlogger
    Skipping config of Apps vhost
    Configuring Jailkit
    Configuring Database
    Updating ISPConfig
    ISPConfig Port [8080]:
    
    Create new ISPConfig SSL certificate (yes,no) [no]:
    
                   
    
    Reconfigure Crontab? (yes,no) [yes]:
    
    Updating Crontab
    Restarting services ...
    Update finished.
    
    
     # apt-get update
    Ign:1 http://deb.debian.org/debian stretch InRelease
    Hit:2 http://security.debian.org stretch/updates InRelease                 
    Hit:3 http://deb.debian.org/debian stretch-updates InRelease               
    Hit:4 http://deb.debian.org/debian stretch Release                                                    
    Reading package lists... Done             
    
    
    # apt-get upgrade
    Reading package lists... Done
    Building dependency tree     
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    8 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n]
    Setting up dovecot-core (1:2.2.27-3+deb9u4) ...
    ucfr: Attempt from package dovecot-core  to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core
    ucfr: Aborting.
    dpkg: error processing package dovecot-core (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-lmtpd:
     dovecot-lmtpd depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-lmtpd (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-mysql:
     dovecot-mysql depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-mysql (--configure):
     dependency problems - leaving unconfigured
    Setting up rkhunter (1.4.2-6+deb9u1) ...
    ucfr: Attempt from package rkhunter  to take /etc/default/rkhunter away from package 3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:rkhunter
    ucfr: Aborting.
    dpkg: error processing package rkhunter (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-sieve:
     dovecot-sieve depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-sieve (--configure):
     dependency problems - leaving unconfigured
    Setting up openssh-server (1:7.4p1-10+deb9u6) ...
    ucfr: Attempt from package openssh-server  to take /etc/ssh/sshd_config away from package 1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:openssh-server
    ucfr: Aborting.
    dpkg: error processing package openssh-server (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-pop3d:
     dovecot-pop3d depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-pop3d (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-imapd:
     dovecot-imapd depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-imapd (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     dovecot-core
     dovecot-lmtpd
     dovecot-mysql
     rkhunter
     dovecot-sieve
     openssh-server
     dovecot-pop3d
     dovecot-imapd
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    the process don't change my postfix configuration but it does with dovecot. The dovecot.conf file is new.
     
    Last edited: Apr 11, 2019
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to update dovecot first and then you do an ispconfig update to replace the stock dovecot config file with the right one for ispconfig. You did it the other way round which means that the old dovecot version was still there so ispconfig installed a dovecot config file for the old version again instead of using one for the new version.
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Please run the command and post the result:

    apt-cache policy dovecot-core
     
  14. MaxT

    MaxT Active Member

    it is:
    Code:
    #  apt-cache policy dovecot-core 
    dovecot-core:
      Installed: 1:2.2.27-3+deb9u4
      Candidate: 1:2.2.27-3+deb9u4
      Version table:
     *** 1:2.2.27-3+deb9u4 500
            500 http://security.debian.org stretch/updates/main amd64 Packages
            100 /var/lib/dpkg/status
         1:2.2.27-3+deb9u2 500
            500 http://deb.debian.org/debian stretch/main amd64 Packages
    
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess you will either have to find out what the new dovecot does not like in the config file and change it manually or uninstall and purge dovecot and then reinstall it and do an ispconfig update afterwards. The next time you should choose to replace the dovecot config file when apt asks and then do an ispconfig update afterwards.
     
    MaxT likes this.
  16. MaxT

    MaxT Active Member

    I tried that, and it seems quite impossible to uninstall dovecot.

    First I tried:
    Code:
    # apt-get purge --remove dovecot-common
    
    # apt-get install dovecot-common
    
    without result. Same errors and no question to install a new config gile.

    If a do an update of ISPC with reconfiguring services, no change, and the same errors appears for an upgrade.


    I tried a new install by deleting all the references to dovecot including dir /etc/dovecot
    Code:
    # service dovecot stop
    
    # rm -f /etc/rc*.d/K03dovecot
    # rm -fr /etc/dovecot
    
    # apt-get purge --remove dovecot-core
    
    but still I see:

    Code:
    # dpkg --get-selections | grep dovecot
    
    dovecot-core                                    install
    dovecot-imapd                                   install
    dovecot-lmtpd                                   install
    dovecot-pop3d                                   install
    dovecot-sieve                                   install
    
    then I do:
    Code:
    #dpkg -P dovecot-core
    #dpkg -P dovecot-imapd
    #dpkg -P dovecot-lmtpd                  
    #dpkg -P dovecot-pop3d                  
    #dpkg -P dovecot-sieve
    
    and with # dpkg --get-selections | grep dovecot
    it doesn't show nothing.

    Then I try a new install
    #apt-get install dovecot-common

    and now the /etc/dovecot was created but it was empty, without any file.

    To avoid being without dovecot, I have copied all my previous config files inside. Then I restart, and the dovecot /var/log/mail.log complains about no mysql driver. Then I install:
    Code:
    # apt-.get install dovecot-mysql                              
    # service dovecot restart
    
    and in that way it works, although showing the same errors to do an update

    It is strange because the update logs shows:
    Code:
    ucfr: Attempt from package dovecot-core  to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core
    
    even when I have deleted the /etc/dovecot directory before and it doesn't exist

    Also, there is the error to update openssh-sever with config file /etc/ssh/sshd_config despite I have exactly the same file in another machine in where there is no this error
    Code:
    ucfr: Attempt from package openssh-server  to take /etc/ssh/sshd_config away from package 1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:openssh-server
    

    After doing #apt clean the cache shows still the same:

    Code:
    # apt-cache policy dovecot-core
    dovecot-core:
      Installed: (none)
      Candidate: 1:2.2.27-3+deb9u4
      Version table:
         1:2.2.27-3+deb9u4 500
            500 http://security.debian.org stretch/updates/main amd64 Packages
         1:2.2.27-3+deb9u2 500
            500 http://deb.debian.org/debian stretch/main amd64 Packages
       
    
    the attempts to do an upgrade show same errors (now worse because there are more dovecot packages involved):

    Code:
    # apt-get upgrade
    Reading package lists... Done
    Building dependency tree  
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    7 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n]
    Setting up dovecot-core (1:2.2.27-3+deb9u4) ...
    ucfr: Attempt from package dovecot-core  to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core
    ucfr: Aborting.
    dpkg: error processing package dovecot-core (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-lmtpd:
     dovecot-lmtpd depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-lmtpd (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-mysql:
     dovecot-mysql depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-mysql (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-sieve:
     dovecot-sieve depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-sieve (--configure):
     dependency problems - leaving unconfigured
    Setting up openssh-server (1:7.4p1-10+deb9u6) ...
    ucfr: Attempt from package openssh-server  to take /etc/ssh/sshd_config away from package 1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:openssh-server
    ucfr: Aborting.
    dpkg: error processing package openssh-server (--configure):
     subprocess installed post-installation script returned error exit status 4
    dpkg: dependency problems prevent configuration of dovecot-pop3d:
     dovecot-pop3d depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-pop3d (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of dovecot-imapd:
     dovecot-imapd depends on dovecot-core (= 1:2.2.27-3+deb9u4); however:
      Package dovecot-core is not configured yet.
    
    dpkg: error processing package dovecot-imapd (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     dovecot-core
     dovecot-lmtpd
     dovecot-mysql
     dovecot-sieve
     openssh-server
     dovecot-pop3d
     dovecot-imapd
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    I'm really missed here. I don't know what to do to reinstall dovecot in a clean way
     
  17. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I believe this is the real problem:
    The APT system still knows that configuration file belongs to some other dovecot-core. Did you have dovecot installed from outside of Debian previously?
    What is that long string of 4:? And the 1: in SSH case? Is that really displayed on your screen or some artifact from cutting and pasting here?
    I'm not sure dpkg -P is suitable if you have installed packages using APT. Maybe that does remove the package and conffiles, but APT does not know about this purge.
    So I would do
    Code:
    apt-get purge dovecot-core
    Repeat same for all dovecot packages, if they remain installed after that.
    Then try installing the dovecot packages you need.
    If there still are complaints about not configured yet, force configuration with
    Code:
    dpkg-reconfigure -plow dovecot-core
    If the above proceeds without errors, do the ISPConfig forced reconfigure like @till suggested.
     
    MaxT likes this.
  18. MaxT

    MaxT Active Member

    no... Dovecot comes only from repos. Well, although after reading what you says, here I have tried also with outer packets

    I've done the ppruge of all packets and then a new install without success:
    apt-get purge dovecot-core
    apt-get purge dovecot-imapd
    apt-get purge dovecot-lmtpd
    apt-get purge dovecot-pop3d
    apt-get purge dovecot-sieve

    same error appears:
    Code:
    ucfr: Attempt from package dovecot-core  to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core
    
    it repeats every time.

    Also I tried
    # apt-get remove dovecot-* --purge
    and no success.

    I tried to delete all the ucf cache references to dovecot:
    # rm -fr /var/lib/ucf/cache/*dovecot*

    and then doing a search with #updatedb + #locate dovecot, and deleting all files until no trace of dovecot reference was present in the system. Then I tried again an install, and again the same error:
    Code:
    "ucfr: Attempt from package dovecot-core  to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core 
    Thinking that maybe the fault was in the packet, I tried a manual install of the packet:
    Code:
    # wget http://security.debian.org/debian-security/pool/updates/main/d/dovecot/dovecot-core_2.2.27-3+deb9u4_amd64.deb
    # dpkg -i dovecot-core_2.2.27-3+deb9u4_amd64.deb
    
    with same result "ucfr: Attempt from package dovecot-core....".

    And again cleaning the whole system, and then trying with a previous dovecot version (which need some libssl libraries which also I have installed) (http://ftp.debian.org/debian/pool/main/d/dovecot/dovecot-core_2.2.13-12~deb8u4_amd64.deb)

    and getting the same result:
    "ucfr: Attempt from package dovecot-core to take /etc/dovecot/dovecot.conf away from package 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core"

    in all the cases, "#dpkg-reconfigure -plow dovecot-core" shows:
    "/usr/sbin/dpkg-reconfigure: dovecot-core is broken or not fully installed"

    The explanation "ucfr cannot take away /etc/dovecot/dovecot.conf from dovecot-core" is really useless. File dovecot.conf is inside that compressed file and it only needs the uncompress operation to go inside /etc/dovecot.

    It seems there is a very poor maintenance of this packet. Searching in Google, I have found this problem with dovecot in different variations from year 2013 and without a clear solution. If the guys in charge of this packet are not able to put enough information of errors in the install process, for sure I will not be able to discover the cause.

    I will do a reinstall of this VPS some day. Meanwhile I keep dovecot outside of updates.

    if you have any other idea I will be happy to try

    thanks for your help !
     
    Last edited: Apr 13, 2019
  19. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You did not answer my question about where do those strings of 4:4:4: and 1:1:1 come from.
    If that really is what the command outputs, it seems your system has installed a package with name 4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core.
    So you should check if that is the case and remove with purge that package.
    Code:
    apt-cache search dovecot --names-only
    Then examine the same problem for ssh.
     
    MaxT likes this.
  20. MaxT

    MaxT Active Member

    no.. I don't have installed any package 4:4:4.... neither I use any added software for copy/paste or similar.

    Perhaps some variable from .bashrc or the environment?

    That apt command shows:
    Code:
     # apt-cache search dovecot --names-only
    argonaut-dovecot - Argonaut (client-module for dovecot)
    dovecot-core - secure POP3/IMAP server - core files
    dovecot-dbg - secure POP3/IMAP server - debug symbols
    dovecot-dev - secure POP3/IMAP server - header files
    dovecot-gssapi - secure POP3/IMAP server - GSSAPI support
    dovecot-imapd - secure POP3/IMAP server - IMAP daemon
    dovecot-ldap - secure POP3/IMAP server - LDAP support
    dovecot-lmtpd - secure POP3/IMAP server - LMTP server
    dovecot-lucene - secure POP3/IMAP server - Lucene support
    dovecot-managesieved - secure POP3/IMAP server - ManageSieve server
    dovecot-mysql - secure POP3/IMAP server - MySQL support
    dovecot-pgsql - secure POP3/IMAP server - PostgreSQL support
    dovecot-pop3d - secure POP3/IMAP server - POP3 daemon
    dovecot-sieve - secure POP3/IMAP server - Sieve filters support
    dovecot-solr - secure POP3/IMAP server - Solr support
    dovecot-sqlite - secure POP3/IMAP server - SQLite support
    dovecot-antispam - Dovecot plugins for training spam filters
    fusiondirectory-plugin-dovecot - dovecot plugin for FusionDirectory
    fusiondirectory-plugin-dovecot-schema - LDAP schema for FusionDirectory dovecot plugin
    mysqmail-dovecot-logger - real-time logging system in MySQL - Dovecot traffic-logger
    however, after reading what you says about a 4:4:4... package, I have looked inside ucfr and I have found a function giving that error message:

    Code:
    # nano /usr/bin/ucfr
     
    replace_in_registry () {
        if [ ! -e "$statedir/registry" ]; then
            echo >&2 "$progname: Internal error: $statedir/registry does not exist";
            exit 6;
        fi
        if [ "$count" -eq 1 ]; then
            old_pkg=$(egrep "[[:space:]]${real_conf_file_re}$" "$statedir/registry" | \
                awk '{print $1;}' );
    
            if [ "$pkg" != "$old_pkg" ]; then
                if [ "X$FORCE" = "X" ]; then
    
                #### here it is !!  #####
                    echo >&2 "$progname: Attempt from package $pkg  to take ${real_conf_file} away from package $old_pkg";
                    echo >&2 "ucfr: Aborting.";
                    exit 4;
                fi
            else
                if [ "X$VERBOSE" != "X" ]; then
                    echo >&2 "$progname: Association already recorded. No changes.";
                fi
                exit 0;
            fi
        fi
     
    then I have searched for all named "registry" files, and I have found a file named "registry.4" which sounds like a probable "4" named file:

    Code:
    # locate registry
    ...
    /var/lib/ucf/registry
    /var/lib/ucf/registry.0
    /var/lib/ucf/registry.1
    /var/lib/ucf/registry.2
    /var/lib/ucf/registry.3
    /var/lib/ucf/registry.4
    /var/lib/ucf/registry.5
    ...
    
    and effectively, inside this registry file, in the beginning there are quite references of this type:
    Code:
    # nano /var/lib/ucf/registry.4
    1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:openssh-server       /etc/ssh/sshd_config
    2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:2:grub-pc      /etc/default/grub
    3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:3:rkhunter       /etc/default/rkhunter
    4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:4:dovecot-core     /etc/dovecot/dovecot.conf
    5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:5:dovecot-core       /etc/dovecot/dovecot-dict-auth.conf.ext
    6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:6:dovecot-core         /etc/dovecot/dovecot-dict-sql.conf.ext
    7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:7:dovecot-core   /etc/dovecot/dovecot-sql.conf.ext
    8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:8:dovecot-core     /etc/dovecot/conf.d/10-auth.conf
    9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:9:dovecot-core       /etc/dovecot/conf.d/10-director.conf
    10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:10:dovecot-core   /etc/dovecot/conf.d/10-logging.conf
    11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:dovecot-core      /etc/dovecot/conf.d/10-mail.conf
    12:12:12:12:12:12:12:12:12:12:12:12:12:12:12:12:12:12:12:12:dovecot-core         /etc/dovecot/conf.d/10-master.conf
    13:13:13:13:13:13:13:13:13:13:13:13:13:13:13:13:13:13:13:dovecot-core    /etc/dovecot/conf.d/10-tcpwrapper.conf
    14:14:14:14:14:14:14:14:14:14:14:14:14:14:14:14:14:14:dovecot-core       /etc/dovecot/conf.d/15-lda.conf
    15:15:15:15:15:15:15:15:15:15:15:15:15:15:15:15:15:dovecot-core          /etc/dovecot/conf.d/15-mailboxes.conf
    16:16:16:16:16:16:16:16:16:16:16:16:16:16:16:16:dovecot-core     /etc/dovecot/conf.d/90-acl.conf
    17:17:17:17:17:17:17:17:17:17:17:17:17:17:17:dovecot-core        /etc/dovecot/conf.d/90-plugin.conf
    18:18:18:18:18:18:18:18:18:18:18:18:18:18:dovecot-core   /etc/dovecot/conf.d/90-quota.conf
    19:19:19:19:19:19:19:19:19:19:19:19:19:dovecot-core      /etc/dovecot/conf.d/auth-checkpassword.conf.ext
    20:20:20:20:20:20:20:20:20:20:20:20:dovecot-core         /etc/dovecot/conf.d/auth-deny.conf.ext
    21:21:21:21:21:21:21:21:21:21:21:dovecot-core    /etc/dovecot/conf.d/auth-dict.conf.ext
    22:22:22:22:22:22:22:22:22:22:dovecot-core       /etc/dovecot/conf.d/auth-master.conf.ext
    23:23:23:23:23:23:23:23:23:dovecot-core          /etc/dovecot/conf.d/auth-passwdfile.conf.ext
    24:24:24:24:24:24:24:24:dovecot-core     /etc/dovecot/conf.d/auth-sql.conf.ext
    25:25:25:25:25:25:25:dovecot-core        /etc/dovecot/conf.d/auth-static.conf.ext
    26:26:26:26:26:26:dovecot-core   /etc/dovecot/conf.d/auth-system.conf.ext
    27:27:27:27:27:dovecot-core      /etc/dovecot/conf.d/auth-vpopmail.conf.ext
    28:28:28:28:dovecot-lmtpd        /etc/dovecot/conf.d/20-lmtp.conf
    29:29:29:dovecot-sieve   /etc/dovecot/conf.d/90-sieve.conf
    30:30:dovecot-sieve      /etc/dovecot/conf.d/90-sieve-extprograms.conf
    31:dovecot-pop3d         /etc/dovecot/conf.d/20-pop3.conf
    dovecot-imapd    /etc/dovecot/conf.d/20-imap.conf
    apt-listchanges          /etc/apt/listchanges.conf
    php7.0-common    /etc/php/7.0/mods-available/calendar.ini
    php7.0-common    /etc/php/7.0/mods-available/ctype.ini
    php7.0-common    /etc/php/7.0/mods-available/exif.inidovecot-imapd    /etc/dovecot/conf.d/20-imap.conf
    apt-listchanges          /etc/apt/listchanges.conf
    php7.0-common    /etc/php/7.0/mods-available/calendar.ini
    php7.0-common    /etc/php/7.0/mods-available/ctype.ini
    php7.0-common    /etc/php/7.0/mods-available/exif.ini
    
    it seems to be like a corruption or something like that. I don't know really how works this registry function.

    Do you know something about this?. I don't have idea. Seems to be like a registry of relations between installed packets and their config files.

    Can I delete directly all these corrupted references and then doing a new apt-upgrade? Or there is need of some later command to recover the normal state of this primitive artifact?.

    thanks for the help!

    ** edit: now I see all the /var/lib/ucf/registry.x files contains these strange references.
     
    Last edited: Apr 14, 2019

Share This Page