Backup And Restore Linux Desktop System Settings With Dconf

Configurare noua (How To)

Situatie

This 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.

Solutie

Pasi de urmat

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, Manjaro Linux:

$ sudo pacman -S dconf

On Debian, Ubuntu, Pop OS, Linux Mint:

$ sudo apt install dconf*

On CentOS / Fedora:

$ 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, it is one of the easiest way to backup and restore system settings with a just single command.

To backup your current Linux desktop settings, all you have to do is:

$ 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

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

Keep the backup file in a safe place to use it later after reinstalling your Linux desktop. You can also 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

Tip solutie

Permanent
Etichetare:

Voteaza

(15 din 36 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?