Home Linux Tips & Tricks Backup And Restore Linux Desktop System Settings With Dconf

Backup And Restore Linux Desktop System Settings With Dconf

By sk
Published: Updated: 24.6K views

A while ago, I explained how to reset a Linux desktop settings, tweaks and customization to default state with a single command. Today, we are going to learn how to backup and restore Linux desktop system settings with Dconf tool.

This tip will be useful when you wanted to transfer same system settings after reinstalling your Linux desktop system, without having to manually do them one by one.

Install Dconf On Linux

Dconf comes pre-installed in many Linux distributions. If it is not installed already, you can install it using the distribution's default package manager depending upon the distribution you use.

On Arch Linux, Endeavour OS, Manjaro Linux:

$ sudo pacman -S dconf

On Debian, Ubuntu, Pop OS, Linux Mint:

$ sudo apt install dconf*

On CentOS, Fedora, AlmaLinux, Rocky Linux:

$ sudo yum install dconf

Or,

$ sudo dnf install dconf

On openSUSE:

$ sudo zypper install dconf

Backup And Restore Linux Desktop System Settings With Dconf

Believe or not, this is one of the easiest way to backup and restore system settings with a just single command.

To backup your current Linux desktop settings using dconf, do run this command:

$ dconf dump / > ostechnix-desktop

The above command will save all customization and tweaks you made in your system, including the pinned applications in the Dock or Unity launcher, desktop panel applets, desktop indicators, your system fonts, GTK themes, Icon themes, monitor resolution, keyboard shortcuts, window button placement, menu and launcher behaviour etc., in a text file named ostechnix-desktop.

Please note that this command will only backup the system settings. It won’t save settings of other applications that doesn’t use dconf. Also, it won’t backup your personal data either.

You can view this file using any text editors or cat command.

$ cat ostechnix-desktop

Here is my Ubuntu 18.04 desktop settings:

view Linux desktop system settings taken with dconf
View Linux desktop system settings taken with dconf

Now reset your desktop settings to the factory defaults with command:

$ dconf reset -f /

After running the above command, your Linux desktop will turn into the old state when you installed it in the first time. Don't panic! Your personal data and installed applications will still be intact.

To restore the System settings, simply do:

$ dconf load / < ostechnix-desktop

It's that simple!!

Have a look at the following visual demo:

Keep the backup file in a safe place to use it later after reinstalling your Linux desktop.

You can use the same backup to multiple systems that runs the same OS version with same set of applications. For example if you have another Ubuntu 18.04 GNOME desktop, you can use this same file (i.e. ostechnix-desktop) to load the same settings as in your current system.

It is also possible to backup and restore settings for specific desktop environments like GNOME, MATE, Cinnamon etc.

Backup And Restore GNOME-specific Settings Only

For example, to backup and restore settings related to GNOME shell, the command would be:

$ dconf dump /org/gnome/ > my_gnome_settings

Make sure you have mention the correct path of the DE if you multiple DEs on your system.

Reset to factory defaults:

$ dconf reset -f /org/gnome/

To restore Gnome-only settings:

$ dconf load /org/gnome/ < my_gnome_settings

You can even backup more specific settings like desktop or window manager.

$ dconf dump /org/gnome/desktop/wm/preferences/ > old_wm_settings

Backup And Restore MATE-specific Settings Only

Backup settings:

$ dconf dump /org/mate/ > mate_settings

Reset to factory defaults:

$ dconf reset -f /org/mate/

To restore settings:

$ dconf load /org/mate/ < mate_settings

Backup And Restore Settings Of Cinnamon Desktop Only

$ dconf dump /org/cinnamon/ > cinnamon_settings

Reset to factory defaults:

$ dconf reset -f /org/cinnamon/

To restore settings:

$ dconf load /org/cinnamon/ < cinnamon_settings

For more details, check man pages.

$ man dconf

You May Also Like

10 comments

W. Anderson March 6, 2020 - 3:47 am

there was no reference to backing up KDE Desktop

Reply
sk March 6, 2020 - 2:55 pm

As far as I know, KDE doesn’t use dconf. So this tutorial doesn’t help for KDE users. May be you can find the settings saved in .kde/share/config/kioslaverc. I don’t have a KDE system now, so I can’t confirm.

Reply
KOUASSI GERARD March 7, 2020 - 1:55 am

I LOST THE BACKED FILE (localhost.localdomain.desktop , fedora 31) so i wasn’t able to restore my desktop configuration

Reply
Ander November 17, 2024 - 5:11 am

Yikes. Don’t lose your files. ;?)

Reply
Vladimir March 16, 2020 - 2:47 am Reply
Msandy March 9, 2021 - 10:56 am

You will need to use the -f option when restoring as well.

dconf load -f / < backup

Otherwise you get a non writeable key error. The -f will write what can be written and ignore the non writeable keys.

Reply
sk March 9, 2021 - 2:26 pm

Thanks for the input. Much appreciated.

Reply
Oliver April 5, 2022 - 7:32 pm

Fantastic, but I’m going to need that amazing wallpaper. 🙂

Reply
sk April 6, 2022 - 12:00 pm

I don’t have it unfortunately. Search on google.

Reply
Ander November 17, 2024 - 5:11 am

Thanks for all this—very helpful! Cheers!

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More