How to Fix ‘semanage command’ Not Found Error in CentOS/RHEL

I am trying to configure a Samba share with correct boolean and security context values using semanage command to make changes in SELinux policy to allow access to Samba share from remote clients on my RHEL 8 server, but I suddenly encountered the following error.

# semanage fcontext --at samba_share_t "/finance(/.*)?"

-bash: semanage: command not found
Semanage Command Not Found Error

semanage Command Not Found Error

semanage is an SELinux (Security-Enhanced Linux) management tool that is used to configure specific elements without making any adjustments to or reassembling from policy sources. Semanage consist of mapping from Linux username to SELinux user identities and it also includes mapping security context for numerous kind of objects like interface, network port, etc.

I was wondering how to fix this error and I am not able to find what package provides semanage command. After a bit of research, I came to know that you need to use yum provides the option to find out the package that provides the queried file called /usr/sbin/semanage.

In this short quick article, we will explain how to install necessary packages for getting semanage command using the yum command.

# yum provides /usr/sbin/semanage
Find Packages that Provide the Queried File

Find Packages that Provide the Queried File

From the above sample output, you can see that we need to install policycoreutils-python-utils-2.8-16.1.el8.noarch package to use the semanage command.

# yum install policycoreutils-python-utils
Install Policycoreutils Python Package

Install Policycoreutils Python Package

Once the installation is complete, try running the semanage command again, it will work like magic.

You can also use the following commands to get the manual page on semanage command options and usage.

# man semanage
OR
# semanage --help
Semanage Command Help

Semanage Command Help

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Anusha Saive

Anusha worked for many years in the IT industry as a Project Manager, and also a senior writer and editor at Tecmint. She is a huge fan of Linux and is passionate about writing Linux and technology related stuff. Follow Her On: Facebook and Instagram

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.