How to Install and Uninstall apparmor Ubuntu 22.04

Updated: September 1, 2022

apparmor provides the system initialization scripts needed to use the AppArmor Mandatory Access Control system, including the AppArmor Parser which is required to convert AppArmor text profiles into machine-readable policies that are loaded into the kernel for use with the AppArmor Linux Security Module. In this guide, I will show you how to install apparmor on Ubuntu 22.04.

Requirements

  • Operating system: apparmor needs Ubuntu 22.04 to work
  • Privileges: Ascertain that you are able to execute sudo commands.

Prerequisites to install apparmor on Ubuntu 22.04

Install apparmor Ubuntu 22.04

apparmor is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install apparmor using APT

This is one of the popular ways to install any Ubuntu packages because it is simple to understand, even if you are a Linux novice. Following these steps to get apparmor on your Ubuntu.

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install apparmor Ubuntu by pasting this command into the terminal and pressing Enter.

sudo apt install apparmor

Install apparmor using Aptitude

With Aptitude, users can view a list of available packages and manage their installation, upgrade, and removal of packages. If you didn’t install it on Ubuntu, you need to install it by executing this command.

sudo apt-get -y install aptitude

Then, you can now install apparmor, just following these steps:

Step 1: Update the APT database to download new packages from Ubuntu. Launch the terminal and enter the following Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install apparmor Ubuntu by pasting this command into the terminal and executing it.

sudo aptitude -y install apparmor

Uninstall apparmor on Ubuntu 22.04

Have you ever thought about how difficult it is to uninstall an application from Ubuntu? You are mistaken; anyone can easily uninstall any program, not just a package.

You can uninstall apparmor on Ubuntu by running this command if you installed it using APT or Aptitude.

sudo apt remove --auto-remove apparmor

If you want to uninstall apparmor and delete its data and dependencies, you can also run the following command:

sudo apt autoremove --purge apparmor

Ending

In this guide, I showed you ways to install apparmor on Ubuntu 22.04 and ways to uninstall apparmor too. Please do not hesitate to contact me if you require assistance. I’m delighted to respond.