AppArmor is a great tool to protect your Ubuntu systems. It could however be a little bit restrictive and cause unnecessary problems in some situations.

You can disable and completely remove AppArmor from your Ubuntu installation by following these steps;

It is not recommended to remove AppArmor in production systems. Only remove it in development environment or desktop, whenever necessary.

  1. Stop apparmor service
    $ sudo systemctl stop apparmor
  2. Disable apparmor from starting on system boot
    $ sudo systemctl disable apparmor
    Synchronizing state of apparmor.service with SysV service script with /lib/systemd/systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install disable apparmor
  3. Remove apparmor package and dependencies. (optional)
    $ sudo apt remove -y --purge apparmor
    ##### snipped
    The following packages will be REMOVED:
      apparmor snapd
    0 upgraded, 0 newly installed, 2 to remove and 7 not upgraded.
    ##### snipped

    This will also remove snapd. Only proceed if you don't use snapd to manage your packages.