• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

semanage command not found in CentOS 6 and RHEL 6

February 26, 2014 by Sharad Chhetri 3 Comments

After installing the RHEL 6 and CentOS6 with minimal installation,I was configuring the rsyslog server. While configuring the rsyslog,without verifying I hit the semanage command.And result was with error – bash: semanage: command not found .
The method is applicable to Red Hat based operating system like RHEL 6 and CentOS 6

What is semanage

semanage is a SELinux Policy Management tool.With the help of semanage,we can configure the certain elements of SELinux policy without requiring modification to or recompilation from policy sources.

How to install semanage command in Red Hat based operating system

To install semanage ,run the below given command

yum install policycoreutils-python
[root@localhost ~]# yum install policycoreutils-python
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: centosmirror.go4hosting.in
 * extras: centosmirror.go4hosting.in
 * updates: centosmirror.go4hosting.in
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package policycoreutils-python.x86_64 0:2.0.83-19.39.el6 will be installed
--> Processing Dependency: libsemanage-python >= 2.0.43-4 for package: policycoreutils-python-2.0.83-19.39.el6.x86_64
--> Processing Dependency: audit-libs-python >= 1.4.2-1 for package: policycoreutils-python-2.0.83-19.39.el6.x86_64
--> Processing Dependency: setools-libs-python for package: policycoreutils-python-2.0.83-19.39.el6.x86_64
--> Processing Dependency: libselinux-python for package: policycoreutils-python-2.0.83-19.39.el6.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.0.83-19.39.el6.x86_64
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.2-2.el6 will be installed
---> Package libcgroup.x86_64 0:0.40.rc1-5.el6_5.1 will be installed
---> Package libselinux-python.x86_64 0:2.0.94-5.3.el6_4.1 will be installed
---> Package libsemanage-python.x86_64 0:2.0.43-4.2.el6 will be installed
---> Package setools-libs-python.x86_64 0:3.3.7-4.el6 will be installed
--> Processing Dependency: setools-libs = 3.3.7-4.el6 for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libsefs.so.4(VERS_4.0)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libseaudit.so.4(VERS_4.2)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libseaudit.so.4(VERS_4.1)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.3)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libpoldiff.so.1(VERS_1.3)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libpoldiff.so.1(VERS_1.2)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.1)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libsefs.so.4()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libseaudit.so.4()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libpoldiff.so.1()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: setools-libs-python-3.3.7-4.el6.x86_64
--> Running transaction check
---> Package setools-libs.x86_64 0:3.3.7-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================
 Package                         Arch            Version                      Repository        Size
=====================================================================================================
Installing:
 policycoreutils-python          x86_64          2.0.83-19.39.el6             base             343 k
Installing for dependencies:
 audit-libs-python               x86_64          2.2-2.el6                    base              59 k
 libcgroup                       x86_64          0.40.rc1-5.el6_5.1           updates          125 k
 libselinux-python               x86_64          2.0.94-5.3.el6_4.1           base             202 k
 libsemanage-python              x86_64          2.0.43-4.2.el6               base              81 k
 setools-libs                    x86_64          3.3.7-4.el6                  base             400 k
 setools-libs-python             x86_64          3.3.7-4.el6                  base             222 k

Transaction Summary
=====================================================================================================
Install       7 Package(s)

Total download size: 1.4 M
Installed size: 5.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): audit-libs-python-2.2-2.el6.x86_64.rpm                                 |  59 kB     00:01     
(2/7): libcgroup-0.40.rc1-5.el6_5.1.x86_64.rpm                                | 125 kB     00:02     
(3/7): libselinux-python-2.0.94-5.3.el6_4.1.x86_64.rpm                        | 202 kB     00:04     
(4/7): libsemanage-python-2.0.43-4.2.el6.x86_64.rpm                           |  81 kB     00:01     
(5/7): policycoreutils-python-2.0.83-19.39.el6.x86_64.rpm                     | 343 kB     00:05     
(6/7): setools-libs-3.3.7-4.el6.x86_64.rpm                                    | 400 kB     00:10     
(7/7): setools-libs-python-3.3.7-4.el6.x86_64.rpm                             | 222 kB     00:04     
-----------------------------------------------------------------------------------------------------
Total                                                                 38 kB/s | 1.4 MB     00:37     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libselinux-python-2.0.94-5.3.el6_4.1.x86_64                                       1/7 
  Installing : setools-libs-3.3.7-4.el6.x86_64                                                   2/7 
  Installing : setools-libs-python-3.3.7-4.el6.x86_64                                            3/7 
  Installing : libsemanage-python-2.0.43-4.2.el6.x86_64                                          4/7 
  Installing : libcgroup-0.40.rc1-5.el6_5.1.x86_64                                               5/7 
  Installing : audit-libs-python-2.2-2.el6.x86_64                                                6/7 
  Installing : policycoreutils-python-2.0.83-19.39.el6.x86_64                                    7/7 
  Verifying  : audit-libs-python-2.2-2.el6.x86_64                                                1/7 
  Verifying  : setools-libs-python-3.3.7-4.el6.x86_64                                            2/7 
  Verifying  : libcgroup-0.40.rc1-5.el6_5.1.x86_64                                               3/7 
  Verifying  : libsemanage-python-2.0.43-4.2.el6.x86_64                                          4/7 
  Verifying  : policycoreutils-python-2.0.83-19.39.el6.x86_64                                    5/7 
  Verifying  : setools-libs-3.3.7-4.el6.x86_64                                                   6/7 
  Verifying  : libselinux-python-2.0.94-5.3.el6_4.1.x86_64                                       7/7 

Installed:
  policycoreutils-python.x86_64 0:2.0.83-19.39.el6                                                   

Dependency Installed:
  audit-libs-python.x86_64 0:2.2-2.el6               libcgroup.x86_64 0:0.40.rc1-5.el6_5.1          
  libselinux-python.x86_64 0:2.0.94-5.3.el6_4.1      libsemanage-python.x86_64 0:2.0.43-4.2.el6     
  setools-libs.x86_64 0:3.3.7-4.el6                  setools-libs-python.x86_64 0:3.3.7-4.el6       

Complete!
[root@localhost ~]#  

Note: After installation, check the absolute path of semanage command.
Use the below given command

which semanage

Specimen :

[root@localhost ~]#  which semanage
/usr/sbin/semanage
[root@localhost ~]# 

Alternatively, you can also use the whereis command

whereis semanage

Specimen :

[root@localhost ~]# whereis semanage
semanage: /usr/sbin/semanage /usr/share/man/man8/semanage.8.gz
[root@localhost ~]#

To know more about semanage. Read the man page of semanage

man semanage

(Follow this guide in case man command not found)

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Solution : semanage command not found
  2. Allow only members of Wheel group to use su command on RHEL/CentOS
  3. FAQ on CentOS 7 / RHEL 7 : Alternate of ifconfig command
  4. smbpasswd command not found on CentOS 7 and RHEL 7
  5. create a system account below uid 500 on RHEL/CentOS/Scientific Linux
  6. netstat command not found on CentOS 7 and RHEL 7 (Red Hat Enterprise Linux 7)
  7. How To Find Absolute Full Path Of Command On Linux / Unix : which command
  8. type Command : Display Information About Command Type On Linux
  9. Install MariaDB Server on CentOS 7 / RHEL 7
  10. How to install redis server on CentOS 7 / RHEL 7

Filed Under: Linux, Linux Commands Tagged With: linux command, selinux

Reader Interactions

Comments

  1. Srinivasan says

    January 31, 2017 at 12:46 pm

    Thanks. Its Helped a lot.

    Reply
  2. SR says

    June 23, 2016 at 6:02 pm

    Thanks! Definitely helped!

    Reply
    • sharad chhetri says

      June 24, 2016 at 3:59 pm

      You are welcome Sam!

      Regards
      Sharad

      Reply

Leave a Reply Cancel reply

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.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

Change the default port number of ssh server

How to encode and decode the strings with base64

How to reset forgot root password in CentOS 6.x and Redhat 6.x

curl command to check the http status

Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd’!

How to convert float to integer number

How to use grep command to get fixed pattern or exact keyword

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy