Disable and remove AppArmor on Ubuntu based Linux distributions

AppArmor is security Linux kernel module similar to the SELinux but it's supposed to be easier to setup and maintain. There are many reasons for you to disable it, primary one is that its security features can get in the way of legitimate applications operation. In this article I'm gonna show you how to disable and remove AppArmor from your Ubuntu based Linux distribution.

The thing is actually very simple. First we stop apparmor service using following command:

sudo /etc/init.d/apparmor stop

Next thing to do is to disable this service from starting at boot time using Debian update-rc.d tool:

sudo update-rc.d -f apparmor remove

And at last if we don't wont the AppArmor bits on our hard drive sectors we use this command to remove it for good:

AT THIS POINT APPARMOR WILL NOT RUN WHEN YOUR COMPUTER BOOTS. BEWARE THAT FOLLOWING LINE IS REPORTED NOT TO WORK AS INTENDED DUE TO CHANGES IN PACKAGE DEPENDENCIES SINCE THIS ARTICLE WAS PUBLISHED (Jun 2011.). PROCEEDING COULD MAKE YOUR SYSTEM UNUSABLE.

sudo apt-get --purge remove apparmor apparmor-utils libapparmor-perl libapparmor1

That's it, it was easy? Now feel free to enjoy your AppArmor free PC.

DevGenii

E-commerce is a breeze with Magento Certified Developer Plus & Zend Certified PHP Engineer nearby. Get in touch!

11 thoughts on “Disable and remove AppArmor on Ubuntu based Linux distributions

  1. Peter

    Thanks for the tutorial.
    Note, don’t forget to remove the apparmor commands from your /etc/default/grub file if these were set during the installation of the apparmor application. After changing the file execute the command update-grub to update the grub-loader.

    Reply
    1. Marko Author

      Sorry to hear that but care is due when pasting commands from an article posted 5 years ago. Article text is updated with warning, because AppArmor clearly got much more integrated in last 9 versions since this article was first published.

      Reply
  2. PM19

    Will break your Ubuntu 14x -16x system and remove programs like php-fpm amongst others.

    Just do this
    apt-get remove apparmor apparmor-utils libapparmor-perl
    update-grub

    That should do it.

    Reply

Leave a Reply

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