GNU/Linux >> LINUX-Kenntnisse >  >> Cent OS

semanage-Befehl nicht gefunden in CentOS 7/6 &RHEL 7/6 – Quick Fix

Als ich einen Artikel über die Installation von MongoDB auf CentOS verfasste , musste ich den Befehl semanage ausführen, um eine Änderung in SELinux vorzunehmen Richtlinie, um uns Zugriff auf MongoDB zu gewähren auf Port 27017.

semanage port -a -t mongod_port_t -p tcp 27017

Zu meiner Überraschung bekam ich einen Fehler.

-bash: semanage: command not found

semanage wird verwendet, um bestimmte Teile der SELinux-Richtlinie zu konfigurieren, ohne dass eine Änderung oder Neukompilierung aus Richtlinienquellen erforderlich ist.

Dieser kleine Beitrag wird Ihnen helfen, die notwendigen Pakete zu installieren, um den Semanage-Befehl zu erhalten. Lassen Sie uns sehen, welches Paket uns den ifconfig-Befehl mit YUM bereitstellt Befehl.

yum whatprovides semanage

ODER

yum provides *bin/semanage

Ausgabe:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iitm.ac.in
 * extras: ftp.iitm.ac.in
 * updates: ftp.iitm.ac.in
base/7/x86_64/filelists_db                                                          | 6.7 MB  00:00:01
extras/7/x86_64/filelists_db                                                        | 528 kB  00:00:00
nginx/x86_64/filelists_db                                                           |  39 kB  00:00:00
updates/7/x86_64/filelists_db                                                       | 3.1 MB  00:00:00
policycoreutils-python-2.5-17.1.el7.x86_64 : SELinux policy core python utilities
Repo        : base
Matched from:
Filename    : /usr/sbin/semanage

Aus der obigen Befehlsausgabe können Sie sehen, dass das policycoreutils-python-Paket Ihnen den Semanage-Befehl bereitstellt . Installieren Sie nun das Paket policycoreutils-python mit YUM Befehl.

yum -y install policycoreutils-python

Ausgabe:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iitm.ac.in
 * extras: ftp.iitm.ac.in
 * updates: ftp.iitm.ac.in
Resolving Dependencies
--> Running transaction check
---> Package policycoreutils-python.x86_64 0:2.5-17.1.el7 will be installed
--> Processing Dependency: setools-libs >= 3.3.8-1 for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-5 for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-17.1.el7.x86_64
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.7.6-3.el7 will be installed
---> Package checkpolicy.x86_64 0:2.5-4.el7 will be installed
---> Package libcgroup.x86_64 0:0.41-13.el7 will be installed
---> Package libsemanage-python.x86_64 0:2.5-8.el7 will be installed
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.8-1.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================
 Package                            Arch               Version                      Repository        Size
===========================================================================================================
Installing:
 policycoreutils-python             x86_64             2.5-17.1.el7                 base             446 k
Installing for dependencies:
 audit-libs-python                  x86_64             2.7.6-3.el7                  base              73 k
 checkpolicy                        x86_64             2.5-4.el7                    base             290 k
 libcgroup                          x86_64             0.41-13.el7                  base              65 k
 libsemanage-python                 x86_64             2.5-8.el7                    base             104 k
 python-IPy                         noarch             0.75-6.el7                   base              32 k
 setools-libs                       x86_64             3.3.8-1.1.el7                base             612 k

Transaction Summary
===========================================================================================================
Install  1 Package (+6 Dependent packages)

Total download size: 1.6 M
Installed size: 5.1 M
Downloading packages:
(1/7): audit-libs-python-2.7.6-3.el7.x86_64.rpm                                     |  73 kB  00:00:00
(2/7): libsemanage-python-2.5-8.el7.x86_64.rpm                                      | 104 kB  00:00:00
(3/7): python-IPy-0.75-6.el7.noarch.rpm                                             |  32 kB  00:00:00
(4/7): checkpolicy-2.5-4.el7.x86_64.rpm                                             | 290 kB  00:00:00
(5/7): setools-libs-3.3.8-1.1.el7.x86_64.rpm                                        | 612 kB  00:00:00
(6/7): policycoreutils-python-2.5-17.1.el7.x86_64.rpm                               | 446 kB  00:00:00
(7/7): libcgroup-0.41-13.el7.x86_64.rpm                                             |  65 kB  00:00:01
-----------------------------------------------------------------------------------------------------------
Total                                                                      1.4 MB/s | 1.6 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : setools-libs-3.3.8-1.1.el7.x86_64                                                       1/7
  Installing : checkpolicy-2.5-4.el7.x86_64                                                            2/7
  Installing : libcgroup-0.41-13.el7.x86_64                                                            3/7
  Installing : python-IPy-0.75-6.el7.noarch                                                            4/7
  Installing : audit-libs-python-2.7.6-3.el7.x86_64                                                    5/7
  Installing : libsemanage-python-2.5-8.el7.x86_64                                                     6/7
  Installing : policycoreutils-python-2.5-17.1.el7.x86_64                                              7/7
  Verifying  : libsemanage-python-2.5-8.el7.x86_64                                                     1/7
  Verifying  : audit-libs-python-2.7.6-3.el7.x86_64                                                    2/7
  Verifying  : python-IPy-0.75-6.el7.noarch                                                            3/7
  Verifying  : policycoreutils-python-2.5-17.1.el7.x86_64                                              4/7
  Verifying  : libcgroup-0.41-13.el7.x86_64                                                            5/7
  Verifying  : checkpolicy-2.5-4.el7.x86_64                                                            6/7
  Verifying  : setools-libs-3.3.8-1.1.el7.x86_64                                                       7/7

Installed:
  policycoreutils-python.x86_64 0:2.5-17.1.el7

Dependency Installed:
  audit-libs-python.x86_64 0:2.7.6-3.el7               checkpolicy.x86_64 0:2.5-4.el7
  libcgroup.x86_64 0:0.41-13.el7                       libsemanage-python.x86_64 0:2.5-8.el7
  python-IPy.noarch 0:0.75-6.el7                       setools-libs.x86_64 0:3.3.8-1.1.el7

Complete!

Sobald die Installation abgeschlossen ist, führen Sie semanage aus, um zu sehen, ob es verfügbar ist oder nicht.

semanage port -a -t mongod_port_t -p tcp 27017

Jetzt sollten Sie keine Fehler mehr sehen.

Das ist alles.


Cent OS
  1. semanage-Befehl nicht in CentOS 8 / RHEL 8 gefunden

  2. So beheben Sie den Fehler „semanage command“ Not Found in CentOS

  3. CentOS – semanage command not found error – Die Lösung ist da!

  4. „firewall-cmd:command not found“ unter CentOS 8 [Gelöst]

  5. ifconfig-Befehl nicht gefunden – CentOS/RHEL 7

netstat-Befehl unter CentOS 8 / RHEL 8 nicht gefunden – Quick Fix

ifconfig-Befehl nicht gefunden auf CentOS 8 / RHEL 8 – Quick Fix

Linux-Fehlerbehebung – Der Befehl netstat wurde in CentOS 7/8 und RHEL 7/8 nicht gefunden

So beheben Sie, dass der Befehl „Ifconfig“ unter CentOS 7 nicht gefunden wurde

Behebung:Curl-Befehl hat keinen Fehler gefunden

w:Befehl nicht gefunden