IRC:fixconfig [2022-04-10]

About

A broken config or corrupted files of the user might affect applications and render all sorts of strange issues. Sometimes installed addins/desklets might interfere with the desktop environment (DE) too.

Be aware: This tutorial does target the case, where config-files are damaged in their structure. To check for broken owner-ship of files (which is another possible reason for issues) you might want to have additionally a look at IRC:notowner.htm.

Test if being affected

An easy cross-check to exclude user-config/-files as a reason for issues is to create a fresh testuser. Reboot (yes, logout is in some situations not enough) and login as the new user.

If the issue does not show up at the fresh user it's at 99% related to the old users config/files, which should be fixable.

Create fresh test-user

To create a fresh user, open your menu and start typing "users and groups" should show the related tool.

Add a new user there and select it to be setup as "Administrator".

Why Administrator?

It's nice to have a 2nd full account possessing sudo-rights as backup which can be used if the main-account (typically the only one able to run admin tasks) would fail some day.

Additionally a sudo-user can become root and access data of the original user, which a regular user wont be able to do and might get important with a broken main-user account.

Remarks

Read the entire tutorial first, before starting to run commands.

At linux files and folders starting with a dot like ".config" are "hidden" files.

To show them in your file manager you need to show hidden files: Pressing CTRL+H should toggle "show hidden files" - there should be an according option at the menu too.

To show all (hidden) files with the ls-command use:

ls -a

Resetting configs/files - the bigger hammer

Issues affecting multiple applications and/or the desktop are often related to more general settings.

Linux applications will (re)create user settings with default-values, if the related config-file or folder is missing on startup. The same is true for the configuration-database aka dconf.

Prefer to rename configs instead of deleting them - so you got a way back to included data/settings if needed - read below: how to restore backup-copies

To be sure nothing does interfere with resetting (or later with restoring previous) configs you have to ensure that, (almost) no process/application related to the user does run - see why not using the GUI to reset or restore for details.

Thus: Reboot (do not just logout) and switch at the graphical login to the first text console using CTRL+ALT+F1. Login there using your username and password (you can return back to the graphical environment using ALT+F7).

The "game" is always the same:

  1. reboot
  2. switch to a console and login there
  3. rename one of the 'suspect' configs
  4. switch back to the GUI, login and test
  5. proceed with next item if needed

Typical suspects

Work through the list in the given order until you are back to a working GUI:

  1. file: ~/.config/dconf/user - contains most of the global settings related to the DE
  2. gsettings list-recursively >~/dconf-old.txt
    mv ~/.config/dconf/user ~/.config/dconf/user-old
  3. folder: ~/.config - contains most application settings (see below application configs only and Finding difference - recover data/config selectively)
  4. mv ~/.config ~/.config-old
  5. folder: ~/.cache - application-related temporary or data
  6. mv ~/.cache ~/.cache-old
  7. folder: ~/.local - additional extensions of any kind
  8. mv ~/.local ~/.local-old

Application configs only

For issues related to a certain/single application only: It should be enough to close the related application - rename the according config-folder and start the application again to recreate a default-config.

Most applications keep their config-file(s) and/or -folder below ~/.config - typically named like the application itself.

Some applications like to be "special" - having their config stored outside of ~/.config/ like

  1. folder: ~/.mozilla (for firefox)
  2. folder: ~/.thunderbird

workarounds

In some rare situations there might be an instance of an application hanging in the background, blocking a new instance to start or to start cleanly.

Reboot in this case, switch to a console from the login-screen and login there. Rename the according file(s)/folder(s) as needed.

How to restore backup-copies

To be sure nothing does interfere with restoring previous configs you have to exclude any process/application related to the user does run.

Reboot, switch to a console from the login-screen and login there. Rename (or delete) the current versions and rename back the original files as needed.

Commands for the typical suspects:

  1. file: ~/.config/dconf/user
  2. gsettings list-recursively >~/dconf-new.txt
    mv ~/.config/dconf/user ~/.config/dconf/user-new
    mv ~/.config/dconf/user-old ~/.config/dconf/user
  3. folder: ~/.config
  4. mv ~/.config ~/.config-new
    mv ~/.config-old ~/.config
  5. folder: ~/.cache
  6. mv ~/.cache ~/.cache-new
    mv ~/.cache-old ~/.cache
  7. folder: ~/.local
  8. mv ~/.local ~/.local-new
    mv ~/.local-old ~/.local

Finding difference - recover data/config selectively

With linux almost all settings are kept as text-files: You can use a diff-tool if you need to recover single settings or (account-) data from the original config (or if you want just to find/explore offending settings).

The file ~/.config/dconf/user is one of the rare cases, where config information is kept at a binary file. Using the gsettings -tool the current values can be exported to a text-file, which could be used for comparison instead.

To export the current dconf-settings use:

gsettings list-recursively >~/dconf-current.txt

As you want/have to compare complete directories for differences (old-settings folder vs new ones) you should install and run meld.

Running meld does allow you to compare directories + does automatically mark/find files being different. To see the differences of files you just need to double-click them.

Differences in files are shown highlighted and can be copied with a mouse-click to the "other side" to take over changes.

Why not using the GUI to reset or restore

Prefer to reboot and use a text-console to rework config-files, as this does avoid the execution of autostart-applications and GUI-related services: Many applications/services will read their current config at startup and will thus keep a copy of potential unwanted settings (which you should avoid).

If you try to reset or restore config-files for running applications/services might end up in getting some unexpected mix-up of settings, as:

System- or application-related events might enforce updates to the config (=recreating parts of if) while you are trying to restore a previous config (consisting of multiple files) - resulting in some undefined mixture of settings.

Additionally - applications and services tend to write back current config values (the ones kept in internal variables) on application exit to update changes; updating a recent files list is a typical example. As sometimes developers are lazy too - a config-update might not only write back changed values, but result in "write back everything" thus reverting your changes.

The same is true for resetting configs to defaults - as you have no control over applications and services writing back changes - you might end up in getting defective values written to the fresh config on application/service exit.

Related information

IRC:notowner.htmcheck for broken owner-ship of files/folders

© 1998-2023 by ORCUS® GmbH - www.orcus.de (imprint) - we strictly do not track (period) - details: privacy - overview IRC: IRC support

note-1: not tracking does mean too - we are strictly NOT using direct external links within the content = we bother you having to copy&paste offered URLs