Is there a way of doing zypper dup to a newer version of OpenSuse Leap (or switching to tumbleweed/leap) in a way that it removes all the packages but the ones included in selected patterns? Thus after upgrade it feels like if you did a fresh install.
No, not really. But when 15.2 gets released you could simply do
sudo zypper dup --releasever 15.2 dup
That would bring all 15.1 packages to their 15.2 version
then what’s the best way of backing up /home dir so after a full format the chromium browser doesn’t feel it is in a new system?
DUP upgrade should not touch /home
I do not quite get what you are planning now.
When you plan to upgrade using the “switch repos and zypper dup” method then nothing in your /home (being it a separate file system or not) is changed, like gogalthorpe says.
If you plan a “full format”, I assume you mean that also your /home is involved (either because it is an integral part of the / file system, or because you also “format” the /home file system.
And yes in that case all inside /home will be gone and thus also the home directory of the user you are (implicitly talking about) is gone and with it any configuration files of Chromium or what.
When you then want restore that (but why do you “format” when you do not want to loose things?) then you restore from a backup.
When you then ask what the best way of backup is, then I would say, that is the way you always backup /home. Because that is the way of backup you are used to. And that should also be the way of backup you have done restore trials with to test if your recovery procedure works as intended.