Command for re-installing a pattern

Hello.

I look for a way to re-install the pattern mail_server including configuration files as if nothing was never installed.

I could not achieve this from yast gui.

I tried to remove the pattern, then delete the config files ( the files that i guess belonging to the pattern ) ; then re-installing the pattern give many errors when restarting because some files was missing (re-install was incomplete) in spamassassin.

I tried to download all the rpm files in a specific folder ( zypper in --download-only ) then install from the folder using

rpm --install --force --hash --replacefiles -v *.rpm

but the config files was not replaced and i have not found any config file like “some_file.some_suffix.rpmsave” ( yast2save, rpmnew… ).

Any help is welcome.

Make sure you remove the configuration folders in /etc.
Then run


sudo zypper in -f YOURPATTERPACKAGE 

As I said, I have tried that but misses some files and the reinstall failled.

And if you don’t know all the configuration folders and/or files to delete ?
It would be simpler if a single command , or options, would do the job.

It is not logical not to be able to undo what we have installed ourselves.

The above only works for some patterns which are actually packages(Not all patterns have an associated package).

When referencing patterns, and not actual packages

zypper in -f -t pattern *Pattern_name *

TSU

No need to move configuration files unless you want to save them (From the original post, that doesn’t seem to be the case).
When you do a “force re-install” you will over-write everything including configuration files.
When you do an update, you preserve configuration files.

TSU

Not at all.

As i said , I tried :

rpm --install --force --hash --replacefiles -v *.rpm

Does not replace current installed config files.

zypper install --force  -t pattern PATTERN_PACKAGE

Does not replace current installed config files.