I recently had an odd problem where I would install zsh (apt-get install zsh) but it would not install the config files - specifically /etc/zsh/zshenv and friends.

Following some considerable time and effort, I managed to track down this log entry:

deferred_configure '/etc/zsh/zshenv' (= '/etc/zsh/zshenv') useredited=1 distedited=0 what=202

And this explanation:

Removing the file counts as 'editing' it, because for many configuration files the absence of a file is meaningful.

Now, as it happens, I had deleted the /etc/zsh directory, so this would all make sense - except that I had also done apt-get remove zsh!!

So, given that I have uninstalled zsh, when I come to reinstall it, how come it is surprised by the absence of configuration files? They wouldn't be present on a fresh system - that is, one without zsh installed - so how does it know they were there previously?

And how do I stop it?

I know I can pass --force-confmiss, but that's not the point. Indeed, I don't believe this can be done when using apt-get in any case.

I don't want to change how programs are installed. Instead, I want to know how dpkg determines that files which it wouldn't expect to exist in the first place have been deleted by the user. What is the difference between a file that has been deleted, and one that never existed? Is it something to do with apt-get --purge?


From dpkg man page:

--remove package (...) Remove an installed package. This removes everything except conffiles, which may avoid having to reconfigure the package if it is reinstalled later (conffiles are configuration files that are listed in the DEBIAN/conffiles control file).

So you didn't remove completely the zsh, but some information remained into the system. The status the package will be "d" (removed) and not "p" (purged or never seen).

You need to purge the package to remove also the conffiles, so to reinstall the packages as new.

Note: if you are curious, you can check /var/lib/dpkg/ to see what the system knows about your packages.

| improve this answer | |

You need to remove the extraneous config files.

  1. You should install dctrl-tools or grep-status (not both) you can use that grep-status command in a script to delete the extraneous config files

  2. the following command will be useful, instead:

    aptitude purge ~c

    It is a tilde, not a dash. I have heard that aptitude purge ?config-files will also work, but I don't know about that.

    You can replace purge with search if you don't feel safe, first.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.