Close

September 17, 2010

Ubuntu: Fixing the “Not replacing deleted config file”.

A recent upgrade to a new Ubuntu server version, caused my dovecote server to not be happy.   Apparently in my haste, I had kept my old configuration files for Dovecot that had several features replaced or depreciated.  I tried removing the package using “apt-get remove dovecot*”, but my config files were still left behind.

I manually deleted the “/etc/dovecot” and attempted to apt-get install “dovecot-imapd”. The packages installed, however for some reason I got several errors complaining that they would NOT replace deleted config file (“not replacing deleted config file” to be precise). I tried remove apt-get removing the files and reinstalling with “force” commands, but it still would not install the new config files.

The solution was to remove the dovecot packages using apt-get and then purge them through “dpgk”.

dpkg -P dovecot-common
dpkg -P dovecot-imapd

I then was able to re-install the dovecot packages from scratch. I’m not sure why the apt-get purge/autoremove did not remove them completely and “dpkg” did, but I was glad to finally have fixed the issue.