How to reset Ubuntu to default Settings without losing Data

Configurare noua (How To)

Situatie

Need to go to factory settings on your Ubuntu system but don’t want to lose important data? The dconf tool is what you’re looking for. It will reset Ubuntu back to what it was when you first installed it without intervening with other files.

dconf is a low-level configuration management tool that stores system and user settings for GNOME and other desktop applications. By exporting your dconf database, you can preserve all current configurations and restore them later if needed.

Solutie

Creating a Backup

You need to create a backup of your current settings first before trying to restore the previous state in case something goes wrong. There are many ways to create a backup on Linux. For this guide, I’m going to stick to dconf for desktop configuration settings. First, open your terminal and run the command below:

dconf dump / > ~/dconf-backup
Creating a backup of Ubuntu settings using dconf.

This creates a backup named “dconf-backup” in your home directory, which contains all your system settings. If you want to create a backup of only specific settings, that’s also possible. For example, you may only want to save the desktop environment settings. In that case, pass the directory that contains those settings to the dconf command, like this:

dconf dump /org/gnome/ > ~/gnome-settings-backup
Creating a backup of only GNOME settings using dconf.

After taking the backup, you can verify it by inspecting the contents of the backup file to ensure the data was successfully saved. For that, run:

cat ~/dconf-backup

Reading the content of the Ubuntu settings backup file using cat command.

Once you’ve done that, make sure to save a copy of the backup file to an external drive or cloud storage to ensure it’s safe in case anything goes wrong during the reset process.

Resetting Ubuntu to Default Settings

With the backup ready, let’s now reset the Ubuntu settings. To simply reset all application and desktop environment settings, run this command in your terminal:

dconf reset -f /

This command cleans all user-specific settings in the dconf database. It resets configurations for GNOME and other apps that use dconf for storing settings. After this, your desktop should return to the default state. The more customizations you have, the easier you’ll notice the changes.

Similar to the backup, if you don’t want to reset everything, you can target specific parts of your configuration, such as desktop settings, app preferences, or keyboard shortcuts. So, for example, if I wanted to reset only GNOME desktop appearance settings (such as themes, icons, and wallpaper,) I’d run:

dconf reset -f /org/gnome/desktop/

This command will revert all desktop-related configurations to their defaults.

Restoring Old Settings From the Backup

Once you’ve reset Ubuntu to its default settings, you may want to restore the previously backed-up settings if necessary. You can do that using the dconf tool. First, locate the backup file. If you followed the earlier instructions, it should be named “dconf-backup” and located in your home directory or wherever you decided to save it. If it’s in the home directory, then run:

dconf load / < ~/dconf-backup

Replace “~/dconf-backup” with the path to your actual backup file if it’s located somewhere else. This command will import all the settings stored in the backup file, restoring your desktop environment and system preferences to their previous state.

Tip solutie

Permanent

Voteaza

(4 din 6 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?