Why does the error 'ValueError File context for /test is not defined' occurs while trying to delete the Selinux context of files/directories?
Issue
- Unable to delete the Selinux context of a file/directory, below error occurs.
[root@rhel7 test]# ls -lZ /test
total 0
-rw-r--r--. 1 root root unconfined_u:object_r:default_t:s0 0 Jun 25 22:41 file.txt
[root@rhel7 test]# semanage fcontext -d /test
ValueError: File context for /test is not defined
Environment
- Red Hat Enterprise Linux 7.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.