I am trying to run a yum update for selinux-policy-targeted 2.4.6-327.el5. While running the update, I hit the following error:
cp: cannot remove `/etc/selinux/targeted/contexts/files/file_contexts.pre': Permission denied
Error in PREIN scriptlet in rpm package selinux-policy-targeted-2.4.6-327.el5.noarch
error: %pre(selinux-policy-targeted-2.4.6-327.el5.noarch) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping selinux-policy-targeted-2.4.6-327.el5
Any thoughts on what is causing this? How do I work around it? I can manually copy and move the file, if I do that, will the update run correctly?
I can manually copy and move the file,
My apologies - this is incorrect. I cannot move the file manually. I was frustrated and got confused with a different directory. For that matter, I can't write anything in this directory (/etc/selinux/targeted/contexts/files), despite being root and the directory being owned by root with rwx privileges.
Currently, SELINUX is disabled in the /etc/selinux/config file. I suppose I could just leave it like this and function, but I would prefer to apply the updates and have it setup and running.
No, I haven't changed the users or the groups. I just manually double-checked the files to be sure nobody else changed or added anything. I have been beating my head trying to think what else may have changed. This system was, unfortunately, setup several months ago and gets very little use. But I wanted to make sure it was updated with patches and this error is driving me crazy.
I suggest to set SELinux to "permissive". Then try updating again and check /var/log/audit/audit.log for the error. If you have setroubleshootd running (default) you should also see more info about the error in /var/log/messages.