Why the rpm installation fails with the error "error selabel_open (/etc/selinux/disabled/contexts/files/file_contexts) no such file or directory"

Solution Verified - Updated -

Issue

  • When you try to install any package/rpm, it fails and below error occurs:
[root@test]$ rpm -ivh tree-1.1.0-15.el8.x86_64
Verifying...                     ########################[100%]
error: selabel_open: (/etc/selinux/disabled/contexts/files/file_contexts) no such file or directory
error: Plugin selinux: hook tsm_pre failed
  • However, when the SELinux is set to Disabled mode, the packages gets installed properly.

Environment

  • Red Hat Enterprise Linux 8.x.
  • Red Hat Enterprise Linux 7.x.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content