How To Install policycoreutils on CentOS 8

policycoreutils is SELinux policy core utilities

Introduction

In this tutorial we learn how to install policycoreutils on CentOS 8.

What is policycoreutils

Security-enhanced Linux is a feature of the Linux\xae kernel and a number of utilities with enhanced security functionality designed to add mandatory access controls to Linux. The Security-enhanced Linux kernel contains new architectural components originally developed to improve the security of the Flask operating system. These architectural components provide general support for the enforcement of many kinds of mandatory access control policies, including those based on the concepts of Type Enforcement\xae, Role-based Access Control, and Multi-level Security. policycoreutils contains the policy core utilities that are required for basic operation of a SELinux system. These utilities include load_policy to load policies, setfiles to label filesystems, newrole to switch roles.

We can use yum or dnf to install policycoreutils on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install policycoreutils.

Install policycoreutils on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install policycoreutils using dnf by running the following command:

sudo dnf -y install policycoreutils

Install policycoreutils on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install policycoreutils using yum by running the following command:

sudo yum -y install policycoreutils

How To Uninstall policycoreutils on CentOS 8

To uninstall only the policycoreutils package we can use the following command:

sudo dnf remove policycoreutils

policycoreutils Package Contents on CentOS 8

/etc/sestatus.conf
/usr/bin/secon
/usr/bin/semodule_expand
/usr/bin/semodule_link
/usr/bin/semodule_package
/usr/bin/semodule_unpackage
/usr/lib/.build-id
/usr/lib/.build-id/82
/usr/lib/.build-id/82/cceeced2f0c4eef47e38faabbeb0e4491d63ed
/usr/lib/.build-id/88
/usr/lib/.build-id/88/8d5c49052605352998a2805ff74f59e2adf066
/usr/lib/.build-id/8a
/usr/lib/.build-id/8a/5587f1d61e6f93c7dcb0d95639f1e956192bc4
/usr/lib/.build-id/a7
/usr/lib/.build-id/a7/1d8ff0bec6c49e9b5a8d09ad893a08120abf98
/usr/lib/.build-id/b7
/usr/lib/.build-id/b7/f722a57f5b1fa6e239f892e0f1758b45a00b20
/usr/lib/.build-id/bc
/usr/lib/.build-id/bc/0f4e5ed76406456a374222338b6cdf40c907fc
/usr/lib/.build-id/c3
/usr/lib/.build-id/c3/06051e5d50f66d9fcbdf2d41b3b036fae541ec
/usr/lib/.build-id/cb
/usr/lib/.build-id/cb/492b796d66287dfba43937d35f9976260aedf4
/usr/lib/.build-id/e3
/usr/lib/.build-id/e3/d304d9b8a2d8bde4484a7eb85ad76edf6d9667
/usr/lib/.build-id/e4
/usr/lib/.build-id/e4/622dcc528cf6618ce7bb579fcbf92526fee529
/usr/lib/.build-id/ef
/usr/lib/.build-id/ef/93970e2f8010d6e1507864a725392a0df4e1b4
/usr/lib/.build-id/fd
/usr/lib/.build-id/fd/cef1210a4363df3faa2624020fe066347e1ec2
/usr/lib/systemd/system-generators/selinux-autorelabel-generator.sh
/usr/lib/systemd/system/selinux-autorelabel-mark.service
/usr/lib/systemd/system/selinux-autorelabel.service
/usr/lib/systemd/system/selinux-autorelabel.target
/usr/libexec/selinux/hll
/usr/libexec/selinux/hll/pp
/usr/libexec/selinux/selinux-autorelabel
/usr/sbin/fixfiles
/usr/sbin/genhomedircon
/usr/sbin/load_policy
/usr/sbin/restorecon
/usr/sbin/restorecon_xattr
/usr/sbin/semodule
/usr/sbin/sestatus
/usr/sbin/setfiles
/usr/sbin/setsebool
/usr/share/bash-completion
/usr/share/bash-completion/completions/setsebool
/usr/share/doc/policycoreutils
/usr/share/licenses/policycoreutils
/usr/share/licenses/policycoreutils/COPYING
/usr/share/locale/af/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/am/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ar/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/as/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/bal/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/be/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/bg/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/bn/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/bn_IN/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/br/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/bs/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ca/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/cs/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/cy/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/da/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/de/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/de_CH/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/el/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/en_GB/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/es/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/et/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/eu/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/fa/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/fi/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/fr/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ga/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/gl/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/gu/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/he/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/hi/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/hr/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/hu/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ia/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/id/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ilo/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/is/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/it/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ja/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ka/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/kk/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/km/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/kn/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ko/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/lt/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/lv/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/mai/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/mk/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ml/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/mr/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ms/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/nb/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/nds/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ne/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/nl/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/nn/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/nso/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/or/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/pa/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/pl/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/pt/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/pt_BR/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ro/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ru/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/si/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/sk/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/sl/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/sq/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/sr/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/sr@latin/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/sv/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ta/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/te/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/tg/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/th/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/tr/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/uk/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/ur/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/vi/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/zh_CN/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/zh_TW/LC_MESSAGES/policycoreutils.mo
/usr/share/locale/zu/LC_MESSAGES/policycoreutils.mo
/usr/share/man/man1/secon.1.gz
/usr/share/man/man5/selinux_config.5.gz
/usr/share/man/man5/sestatus.conf.5.gz
/usr/share/man/man8/fixfiles.8.gz
/usr/share/man/man8/genhomedircon.8.gz
/usr/share/man/man8/load_policy.8.gz
/usr/share/man/man8/restorecon.8.gz
/usr/share/man/man8/restorecon_xattr.8.gz
/usr/share/man/man8/semodule.8.gz
/usr/share/man/man8/semodule_expand.8.gz
/usr/share/man/man8/semodule_link.8.gz
/usr/share/man/man8/semodule_package.8.gz
/usr/share/man/man8/semodule_unpackage.8.gz
/usr/share/man/man8/sestatus.8.gz
/usr/share/man/man8/setfiles.8.gz
/usr/share/man/man8/setsebool.8.gz
/usr/share/man/ru/man1/secon.1.gz
/usr/share/man/ru/man5/selinux_config.5.gz
/usr/share/man/ru/man5/sestatus.conf.5.gz
/usr/share/man/ru/man8/fixfiles.8.gz
/usr/share/man/ru/man8/genhomedircon.8.gz
/usr/share/man/ru/man8/load_policy.8.gz
/usr/share/man/ru/man8/restorecon.8.gz
/usr/share/man/ru/man8/restorecon_xattr.8.gz
/usr/share/man/ru/man8/semodule.8.gz
/usr/share/man/ru/man8/semodule_expand.8.gz
/usr/share/man/ru/man8/semodule_link.8.gz
/usr/share/man/ru/man8/semodule_package.8.gz
/usr/share/man/ru/man8/semodule_unpackage.8.gz
/usr/share/man/ru/man8/sestatus.8.gz
/usr/share/man/ru/man8/setfiles.8.gz
/usr/share/man/ru/man8/setsebool.8.gz

References

Summary

In this tutorial we learn how to install policycoreutils on CentOS 8 using yum and dnf.