2

When installing an upgrade with sudo apt-get upgrade it displays:

Configuration file '/etc/grub.d/30_os-prober'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** defaults.list (Y/I/N/O/D/Z) [default=N] ?

However, I changed /etc/grub.d/30_os-prober when I set a GRUB password, now I'm not sure what to do. Most likely the best thing to do would be the get package maintainer's config file and then do the same change (merge the files).

I didn't get asked about this on another machine, maybe because unattended-upgrades did the upgrading or because I used Apper (GUI used for updating) instead of the console (why doesn't Apper prompt you about it? is there a question or an issue about that?). It must have chosen the default and I guess not changing config files as well as changing config files can sometimes break things.

How to display all config files that differ from the package maintainers' versions? The respective package that includes this config file should be displayed too. I think reinstalling that package should show the same prompt about the config file again if there is no command to retrieve the config file only.

I'd prefer a way by which one can then easily merge/change/compare these config files with a merge-GUI like Diffuse Merge or Meld (the diff view in the console when pressing D is barely usable).

I'm using Debian11/KDE.

4
  • You could use Z to get a shell (or open one in a separate window if you're in a suitable environment), and then compare the files directly using your preferred tool Oct 19, 2022 at 9:48
  • How so? One file is at /etc/grub.d/30_os-prober but where is the package maintainer's version to compare/merge? Furthermore, this is far too complicated and time-intensive even for people that aren't newcomers or like to use computers for long...it should just prompt the user to open a merge tool / have that as one of the options.
    – mYnDstrEAm
    Oct 19, 2022 at 21:51
  • 1
    If the existing file is /etc/grub.d/30_os-prober then the new file should be the same but with a .dpkg.new suffix. If people are newcomers then they can almost always use "overwrite with package maintainer's version". In such cases the old version is always saved with another .dpkg-* suffix Oct 20, 2022 at 9:08
  • If you press N or install it with a GUI like Apper which use the default (N) without prompting the user, does it also add and keep a .dpkg.new file? Because if it does, maybe that could be used for building a command to show all /etc/ files that differ from the maintainers' versions (if possible with an easy way to show GUI-diffs for all of these).
    – mYnDstrEAm
    Oct 20, 2022 at 9:19

1 Answer 1

3
+50

You can find most changed configuration files with the following command:

debsums -ac

You can go a little further and query the dpkg database to find which packages those files belong to, as suggested in the manpage for debsums(1):

dpkg -S $(debsums -ac)

I don’t know any convenient way to compare the content of the “current” configuration file with the content of the “original” file, especially considering that dpkg does not keep a copy of the configuration files, and that, by default, recent versions of apt clean .deb files for successfully installed packages.

Note that it only works for configuration files that are contained it their packages.

A few packages would rather generate default contents for their configuration files within maintainer scripts and use ucf to update them while preserving local changes. You can find those that were modified with the following command:

md5sum --quiet --check /var/lib/ucf/hashfile

You can can which package created each ucf-managed configuration file in /var/lib/ucf/registry and you can find the “original” files in /var/lib/ucf/cache/. You may also use ucfq to query the ucf database.

4
  • Great. To avoid many Permission denied messages and missing file entries, I'm using the command sudo debsums -ac | grep -v "debsums: missing file". How can one 1) see which packages these config files belong to and 2) compare the current local config file with the repo's/maintainer's config file (preferably with a GUI like Meld)? Moreover, that grep -v command doesn't filter the messages, why is that and how to make it work (it works the other way around without the -v)?
    – mYnDstrEAm
    Oct 31, 2022 at 10:11
  • 1
    I just updated my answer. As for the “missing file” messages, they are output to the error output, but your pipe only redirects the standard output to grep. You may run sudo debsums -ac |& grep -v "debsums: missing file" to get the expected behaviour, but I’d rather suggest you simply redirect the error output to /dev/null with `sudo debsums -ac 2> /dev/null Nov 3, 2022 at 20:46
  • @mYnDstrEAm And thanks for the bounty! Nov 3, 2022 at 20:49
  • The solution command I'm using now for making it also display the package the config file belongs too but not showing the many missing file errors is: sudo dpkg -S $(sudo debsums -ac |& grep -v "debsums: missing file"). . For there being no way to compare the current config file with the latest/original file, I'll (probably) create an issue later and I'll also create one for GUIs like Apper not prompting the user about config file updates.
    – mYnDstrEAm
    Nov 3, 2022 at 22:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .