def rule(event):
    if any(
        [
            all(
                [
                    event.deep_get("Image", default="").endswith("/yum"),
                    any(
                        [
                            "erase" in event.deep_get("CommandLine", default=""),
                            "remove" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            all(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("/apt"),
                            event.deep_get("Image", default="").endswith("/apt-get"),
                        ]
                    ),
                    any(
                        [
                            "remove" in event.deep_get("CommandLine", default=""),
                            "purge" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            all(
                [
                    event.deep_get("Image", default="").endswith("/dpkg"),
                    any(
                        [
                            "--remove " in event.deep_get("CommandLine", default=""),
                            " -r " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            all(
                [
                    event.deep_get("Image", default="").endswith("/rpm"),
                    " -e " in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
