How to restore Ubuntu desktop to first install

In a few days a new version of Ubuntu will be released, with this, many users will update their computers, change their desktops and as a result of all this, the operating system may become slower due to the various libraries and programs that have no function or that is not really used by the end user.

Therefore many users usually perform a clean install of Ubuntu. But you can restore the desktop without having to do a clean install and then remove the leftover packages, without having problems with dependencies.

There is a command for the Gnome, MATE and Unity desktops that not only deletes the configurations of the desktops but also allows us to make backup copies of those configurations to use them later or restore them. The command makes use of the Dconf program, a tool that is present in the aforementioned desktops and that therefore we cannot use in other desktops such as Xfce, Plasma or Lxde.

To do all this we have to open a terminal and write the following:

sudo dconf dump

This command will execute a subfunction to make a backup of our configuration. It is important to do it before the next command because if when restoring the desktop we see that there is something wrong, we can return to the previous configuration and solve the problems.

Now we write in the terminal:

dconf reset -f /

And after this, the desktop of our Ubuntu will return to its initial configuration, as if we installed Ubuntu for the first time. This means that the shortcuts, settings, desktop themes, etc ... will stop working and everything will be returned to default.

Personally, I usually opt for a clean installation, but I have to say that backup and installation takes a while that I don't have, so this trick seems very interesting to me, since it allows us clean our Ubuntu without spending a lot of time on it.