• Hi there and welcome to PC Help Forum (PCHF), a more effective way to get the Tech Support you need!
    We have Experts in all areas of Tech, including Malware Removal, Crash Fixing and BSOD's , Microsoft Windows, Computer DIY and PC Hardware, Networking, Gaming, Tablets and iPads, General and Specific Software Support and so much more.

    Why not Click Here To Sign Up and start enjoying great FREE Tech Support.

    This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Enable AppArmor or SELinux on Ubuntu 16.04 LTS

Not open for further replies.


PCHF's Almighty Ruler
PCHF Owner
Support Team
Security Team
Jan 10, 2015
PCHF Bunker
You can not use AppArmor and SELinux together. It's one or the other.

AppArmor is enabled by default on kernels 2.6.36 and later. SELinux has to be manually installed.

If you wish to do so, you may follow the below instructions at your OWN RISK. I or anyone at PCHF assumes no responsibility for what may happen.

1. Stop the AppArmor script in /etc/init.d/

sudo /etc/init.d/apparmor stop

2. Purge AppArmor from the system.

 sudo apt purge apparmor

If you want to keep AppArmor's config files, use the below command instead:

sudo apt remove apparmor

3. Update and reboot your system

sudo apt update && upgrade -yuf
sudo reboot

4. Install SELinux

sudo apt install selinux
sudo reboot

5. You can determine whether or not SELinux is enforcing security on your system by trying to set SELinux to enforcing mode.

[email protected]:~# sudo setenforce 1
[email protected]:~# sudo getenforce

6. To maintain enforcing mode after reboot, modify the SELinux configuration file in /etc/selinux/config from the default SELINUX=permissive to SELINUX=enforcing

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
Not open for further replies.