Security

How To: Remove AppArmor From Ubuntu

In today’s article, we’re going to learn how to remove AppArmor from Ubuntu. This will work for other distros, like Debian. It’s actually not a very difficult task to remove AppArmor from Ubuntu, but it’s not something you necessarily want to do. Just because you can, doesn’t mean you should…

As many of you know, I write many of these articles based on the notes I’ve taken over the years. I’m a little reluctant to write this one, because removing AppArmor is probably not the best of choices.

AppArmor is similar to the various jails and application isolation techniques. It’s a security tool that restricts applications to a constrained set of resources. If the application is then compromised, it only has access to that set of resources and not to the whole system.

In other words, unless you know what you’re doing, you almost certainly don’t want to remove AppArmor from Ubuntu. In fact, if you don’t know what you’re doing then doing this is almost certainly a ‘not-bright’ choice.

If you’re going to remove AppArmor, you should consider replacing it with something else. SELinux is an option that’s similar, though I suppose you could use something like Firejail and be prepared to craft your own application profiles.

Again, removing AppArmor from Ubuntu (or whatever distro you’re using that has it) is probably not a good idea. I include the article because the information is already out there and because some folks may just decide to operate their system without such protections. This is Linux, you have the freedom to make bad choices. This isn’t even the first time I’ve shown you how to make bad choices.

Remove AppArmor From Ubuntu:

Like oh so many of these articles, you’re gonna need an open terminal. Just press CTRL + ALT + T and your default terminal should open. (I say that a whole lot on this site.)

We should first check to ensure AppArmor exists and is running. To do so, enter the following command:

sudo apparmor_status

What you’re looking for is several lines into the output. You’re looking for ‘apparmor module is loaded‘. If you see that, AppArmor both exists and is running. So, the next step in removing AppArmor is to stop the service. You do that with:

sudo systemctl stop apparmor

In case AppArmor is somehow installed again, we’ll make sure that it won’t start at boot by disabling the service entirely. That seems like a good idea.

sudo systemctl disable apparmor

Finally, we nuke AppArmor from existence with a purge command:

sudo apt purge apparmor

And that should do it. You probably want to reboot, just to make sure there are no tendrils sticking around – but stopping the service first should mean you don’t need to. Either way, you have now removed AppArmor from your system – assuming you followed the directions.

Closure:

Again, and I can’t stress this enough, don’t do this unless you know what you’re doing and unless you have something to replace AppArmor with. It’s really a bad idea and you’ll gain very little. I wouldn’t even do this with a system air-gapped from the network, unless I had a very good reason to do so.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

View Comments

  • Apparmor does nothing for small business and home users. It interferes with almost any hardware including serial ports. Its like having antivirus programs on you computer. Its generates profits but does little for the user. Today, cable modems and wifi routers have more capabities than anti virus software. Sadly, users in the US have remained iliterate when it comes to computer breaches, viruses, and malicious software. Not opening suspicious emails or emails from senders they don't know eliminates almost 100% of viruses. A properly setup router can eliminate the remaining threats if properly configured.
    App armor was stuck into Linux by people who wanted to add a marketing feature for municipalities and big business. It is questionable if it has ever reduced any threats but it has certainly cost millions in chasing non existant hardware problems.

    • While I do not agree with your assessment in principle or in theory, I will absolutely allow your comment to be published.

      I do agree that antivirus software is a waste of resources. Even in my Windows days, I went years without any resident antivirus. I was behind a firewall, however.

  • Apparmor is stopping me from loading new brushes into Gimp. It's a flaming nuisance .

    • That's odd. That's very odd.

      I don't think it should do that...

      Did you install GIMP as a Snap application perhaps?

  • I uninstalled it because the system does not start due to an error.
    The error was related to Samba.
    Bad idea? depends on who is looking at it.
    Deleting it is a quick solution to the error and thus be able to share my folders.

    • Yeah, there are times when it's appropriate. As this site is mostly meant for new users, I'd seldom recommend removing AppArmor unless you have a very valid reason to do so.

      I've never heard of it messing with Samba - but I don't play with Samba for any reason. I don't need Samba for anything, so it's not something I use.

      Another poster mentioned that AppArmor messed with GIMP. I dunno why it'd do that either? My question to them went without an answer, so I haven't gotta clue.

Recent Posts

Enable/Disable Your Network Interface

Today we'll cover one way to enable or disable your network interface in the Linux…

7 months ago

Check Your NIC Speed In The Terminal

Today's exercise is a nice and simple exercise where we check your NIC speed in…

7 months ago

Easily Monitor Your Wireless Connection

Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…

7 months ago

Count The Files In A Directory

I think I've covered this before with the ls command but this time we'll count…

7 months ago

Get System Information With The ‘uname’ Command In Linux

Today we'll be learning about a basic Linux command that's known as 'uname' and it…

7 months ago

hardinfo Has Been Rebooted As hardinfo2

If you've used hardinfo in the past, it may interest you to know that hardinfo…

7 months ago