Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every time I update certain packages with rpm/yum, they reset certain permissions on their files / directories which I have intentionally changed for various reasons. Is there a way I can override the permissions that the packagers have specified in the RPMs, and force it to keep the permissions/owner/group that I've set?

On a Debian system, I would just use "dpkg-statoverride". I can't find any equivalent for RPM systems (CentOS 4 & 5 in my case).

share|improve this question

I don't know the answer to your immediate question. However, I do know that when you run up against permissions problems like this it's a good idea to ask if perhaps there's a better way to go about solving the thing you're really trying to do. What package and files/directories are you changing the permissions on, and why?

Many packages use a specific group, maybe even one of their own, and by adding your user to that group you can get the freedom you need. If you really feel that the package should provide a way for non-root users to get at something in particular, report it as a bug against the package and maybe the maintainers will change it. Or, if you feel the permissions are too lax, report that as a bug too.

Another possibility is password-less sudo with restrictions. You can restrict it to particular users and to the running of particular commands. You could write a wrapper script for whatever it is that users need to do, and then allow password-less use of this script by users in a certain group.

Basically, there are lots of alternative approaches that you can use, which won't cause you to be fighting with the system all the time.

share|improve this answer

Built-in? Don't know of any. We use Puppet to manage our builds, so it's pretty easy to have File resources that depend on the RPM and enforce permissions.

Depending what sort of scale you're dealing with, a lighter solution might be as simple as a small script that chmod/chowns a list of directories/files that you run after each update.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.