5

how to reset a program to its default state?

in android we can clear application data to reset the application to its default state. does it is possible to reset a program in ubuntu to its default state without uninstalling and reinstalling.

  • Just curious, but did any of the answers (or both) help you out? – Jacob Vlijm Apr 28 '18 at 13:46
4

Where are customized properties stored?

Application settings are usually stored either:

  • in ~/.config/application_name
    Example: ~/.config/libreoffice
  • in their own dedicated local (invisible, name starts with a .) folder in ~.
    Example: ~/.gimp-2.8

Furthermore, applications can have one or more settings in the dconf database (gsettings). A simple way to find out if that is the case is to run in a terminal window:

dconf watch /

...and play with the settings.

Lastly, (mostly) locally installed applications possibly created a local .desktop file. If so, you also need to delete that one to make sure you are starting from scratch.

Reset

Th bottom line is to remove these folders, if they exist, and reset the gsettings / dconf values. If you'd like a GUI way to reset thos keys, you can look them up in dconf-editor, and reset them to default.

Local settings folder(s) will be re- created on the next time you run the application.

dconf-editor is not installed by default. To install:

sudo apt install dconf-editor
2

Yes, you can. The method would depend on the particular application. You would have to find the configuration folder for that particular application and rename or delete it.

Many programs use use ~/.config/[app name]. For others, you would have to check with the particular application, or developers to get the folder name.

Some examples for instance:

Thunderbird:     ~/.thunderbird
Google Chrome    ~/.config/
Gedit            ~/.config/dconf/usr (This is configured via gsettings)
Wine             ~/.wine
ssh              ~/.ssh
1

It depends on the type of application and how it handles multiple users. In case of multiple users, there may be one "master" config file, which then gets copied to each user's directory. In certain cases, such as when a user makes a boo-boo or there's a security concern, it's easier to just reinstall the app or the whole OS; sometimes you might just want to try emulate factory reset.

Command-line applications often keep config in /etc/. Notable examples of that are /etc/vim/vimrc and /etc/bash.bashrc. There may also exist extra folders (often ending with a d letter to signify daemons) for particular settings, for example /etc/logrotate.conf and /etc/logrotate.d. Graphical applications often (but not necessarily) use dconf database. Between command-line apps and GUI apps, they may use local files. These may be stored in ~/.conf or just in plain sight in user's home folder.

The appropriate "reset" way depends on the app. Some apps have a button for that, others - may require deleting a config file. In case of GUI apps, one could use dconf or preferably gsettings command with reset for particular setting or reset-recursively for a range of setitngs. You may need to read documentation on those. And there are graphical front ends for that as Jacob Vlijm mentioned in his answer.

As for the case when you can't find what file an app uses, you can look under the hood of an app's behavior; one way is to look at open syscalls in via strace command. For example:

strace -e open firefox

Again, refer to strace's manual for a set of advanced features and options that can help investigating app's behavior and open files.

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.