{
    "mode": "man",
    "parameter": "aa-remove-unknown",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/aa-remove-unknown/8/json",
    "generated": "2026-06-02T21:26:49Z",
    "synopsis": "aa-remove-unknown [option]",
    "sections": {
        "NAME": {
            "content": "aa-remove-unknown - remove unknown AppArmor profiles\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "aa-remove-unknown [option]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "aa-remove-unknown will inventory all profiles in /etc/apparmor.d/, compare that list to the\nprofiles currently loaded into the kernel, and then remove all of the loaded profiles that\nwere not found in /etc/apparmor.d/. It will also report the name of each profile that it\nremoves on standard out.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h, --help",
                    "content": "displays a short usage statement.\n\n-n  dry run; only prints the names of profiles that would be removed\n",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        },
        "EXAMPLES": {
            "content": "$ sudo ./aa-remove-unknown -n\nWould remove 'test//null-/usr/bin/whoami'\nWould remove 'test'\n\n$ sudo ./aa-remove-unknown\nRemoving 'test//null-/usr/bin/whoami'\nRemoving 'test'\n",
            "subsections": []
        },
        "BUGS": {
            "content": "None. Please report any you find to Gitlab at\n<https://gitlab.com/apparmor/apparmor/-/issues>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "apparmor(7)\n\n\n\nAppArmor 3.0.4                               2025-08-15                         AA-REMOVE-UNKNOWN(8)",
            "subsections": []
        }
    },
    "summary": "aa-remove-unknown - remove unknown AppArmor profiles",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "displays a short usage statement. -n dry run; only prints the names of profiles that would be removed"
        }
    ],
    "examples": [
        "$ sudo ./aa-remove-unknown -n",
        "Would remove 'test//null-/usr/bin/whoami'",
        "Would remove 'test'",
        "$ sudo ./aa-remove-unknown",
        "Removing 'test//null-/usr/bin/whoami'",
        "Removing 'test'"
    ],
    "see_also": [
        {
            "name": "apparmor",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/apparmor/7/json"
        },
        {
            "name": "AA-REMOVE-UNKNOWN",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/AA-REMOVE-UNKNOWN/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Remove AppArmor profiles that are no longer present in the configuration directory.",
        "examples": [
            {
                "description": "Perform a dry run to see which profiles would be removed",
                "command": "sudo aa-remove-unknown -n"
            },
            {
                "description": "Actually remove the profiles",
                "command": "sudo aa-remove-unknown"
            },
            {
                "description": "Display help",
                "command": "aa-remove-unknown {{-h|--help}}"
            }
        ]
    }
}