Question

I would like to know how to specify in rpm spec that some files and directories must not be removed during uninstall even if there are not been modified?

I have some directories that contain configuration files. These files are installed with rpm -ivh. Some of installed files are not always modified and should not be remove at uninstall.

Thanks in advance for your help.

Was it helpful?

Solution

I don't think there is a native way to do it. I don't see why you would if they were unmodified; the end user can always rpm2cpio or re-install if they wanted the originals.

However, to do it, you could do something like package all the files into /etc/yourapp/orig/ and then in your %post do something like cp /etc/yourapp/orig/*.conf /etc/yourapp. You'd have to do more advanced stuff to keep it from stomping on previously installed and modified config files, but it's a hackish idea to run with.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top