# rpm -e devtoolset-2-runtime restorecon: lstat(/opt/rh/devtoolset-2/root) failed: No such file or directory warning: %postun(devtoolset-2-runtime-2.0-19.el6.noarch) scriptlet failed, exit status 255 # rpm --scripts -q devtoolset-2-runtime ... postuninstall scriptlet (using /bin/sh): if [ $1 = 0 ]; then /usr/sbin/semanage fcontext -d /opt/rh/devtoolset-2/root restorecon -R /opt/rh/devtoolset-2/root fi Happened during `yum remove devtooolset-2\*' as well. It seems that on rhel6 /opt/rh/devtoolset-2/root belongs to devtoolset-2-runtime package and is removed before the postun scriptlet is run witch causes restorecon to end with 255 return code.
Hopefully just adding '[ -d %{_scl_root} ] &&' will do; it does not make much sense to restore contexts on non-existing files.
(In reply to Marek Polacek from comment #1) > Hopefully just adding '[ -d %{_scl_root} ] &&' will do; it does not make > much sense to restore contexts on non-existing files. Wouldn't adding '[ -d %{_scl_root} ] &&' just change the bad return code from 255 to 1? if-then-fi would be better IMHO.
You're right. I meant '[ -d %{_scl_root} ] && ... || :'.
I put the (untested) fix in, so hopefully fixed.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-0278.html