# Ansible-lint in the Ansible PPA is broken?

**URL:** <https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859>\
**Category:** Get Help\
**Tags:** ubuntu, ansible-lint\
**Created:** [November 19, 2025, 2:34am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859 "2025-11-19T02:34:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 19, 2025, 2:34am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/1 "2025-11-19T02:34:48Z")

</div>

Dear Colleagues,

Who are the maintainers of the Ansible PPA and to whom could I address this issue [ansible and ansible-lint in the PPA are probably incompatible · Issue #4827 · ansible/ansible-lint · GitHub](https://github.com/ansible/ansible-lint/issues/4827) ?

Short summary of the issue: ansible and ansible-lint in the PPA are probably incompatible, after a recent “apt upgrade”, when I try running ansible-lint, I get the following traceback:

```auto
$ ansible-lint
Traceback (most recent call last):
  File "/usr/bin/ansible-lint", line 5, in <module>
    from ansiblelint. __main__ import _run_cli_entrypoint
  File "/usr/lib/python3/dist-packages/ansiblelint/ __main__.py", line 39, in <module>
    from ansiblelint import cli
  File "/usr/lib/python3/dist-packages/ansiblelint/cli.py", line 29, in <module>
    from ansiblelint.yaml_utils import clean_json
  File "/usr/lib/python3/dist-packages/ansiblelint/yaml_utils.py", line 31, in <module>
    from ansiblelint.utils import Task
  File "/usr/lib/python3/dist-packages/ansiblelint/utils.py", line 41, in <module>
    from ansible.parsing.yaml.constructor import AnsibleConstructor, AnsibleMapping
ModuleNotFoundError: No module named 'ansible.parsing.yaml.constructor'

```

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 19, 2025, 5:58am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/2 "2025-11-19T05:58:15Z")

</div>

Ansible and ansible-core comes from: [Ansible in Launchpad](https://launchpad.net/~ansible)

I’m not sure where ansible-lint comes from, I didn’t find a PPA for it in a quick search.

Is it possible that you installed ansible-lint from the system’s repositories, and not from some PPA? That could explain why it doesn’t work with the PPA. You likely have to install ansible from the system repositories as well to make it work with ansible-lint from there. (My guess is that they use different Python interpreters, and thus are incompatible.)

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 19, 2025, 5:59am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/3 "2025-11-19T05:59:54Z")

</div>

The version you’re showing (6.17.2-1) seems to come from the system repositories: [https://packages.ubuntu.com/noble/ansible-lint](https://packages.ubuntu.com/noble/ansible-lint)

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 19, 2025, 7:10am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/4 "2025-11-19T07:10:39Z")

</div>

I have `deb https://ppa.launchpadcontent.net/ansible/ansible/ubuntu noble main` in /etc/apt/sources.list.d/ppa\_ansible\_ansible\_noble.list. Is there a reliable way to find out from which repositories ansible and ansible-lint are actually installed? Here is the current output on my system:

```auto
$ apt list --installed | grep ansible

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

ansible-core/noble,now 2.19.4-1ppa~noble all [installed,automatic]
ansible-lint/noble,now 6.17.2-1 all [installed]
ansible/noble,now 12.2.0-1ppa~noble all [installed]
python3-ansible-compat/noble,now 4.1.11-1 all [installed,automatic]

```

Does the above look like there is a repository mismatch? Or what command could I use to detect a mismatch?

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 19, 2025, 7:40am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/5 "2025-11-19T07:40:49Z")

</div>

You may be right and thank you for the hint! After removing the PPA repo, I get the following versions:

```auto
ansible-core/noble,now 2.16.3-0ubuntu2 all [installed,automatic]
ansible-lint/noble,now 6.17.2-1 all [installed]
ansible/noble,now 9.2.0+dfsg-0ubuntu5 all [installed]
python3-ansible-compat/noble,now 4.1.11-1 all [installed,automatic]

```

and ansible-lint seems to be working. So I was erroneously thinking that ansible-lint was coming from the PPA, while it does not seem to be the case.

However, I need to run the PPA version of Ansible because 2.16 is lacking some features I need. Do you have any ideas how I could get a working ansible-lint while keeping the PPA version of ansible?

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [November 19, 2025, 8:27am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/6 "2025-11-19T08:27:17Z")

</div>

> [@Victor\_Sudakov](#):
>
> However, I need to run the PPA version of Ansible because 2.16 is lacking some features I need.

@Victor_Sudakov I wonder if we can help with the underlying issue. What exactly isn’t working with the latest version of Ansible Core?

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 19, 2025, 9:46am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/7 "2025-11-19T09:46:39Z")

</div>

Hello @gundalow , you can look at [ansible and ansible-lint in the PPA are probably incompatible · Issue #4827 · ansible/ansible-lint · GitHub](https://github.com/ansible/ansible-lint/issues/4827) for more details. In short, any invocation of ansible-lint outputs the following error:

```auto

$ ansible-lint --version
Traceback (most recent call last):
  File "/usr/bin/ansible-lint", line 5, in <module>
    from ansiblelint. __main__ import _run_cli_entrypoint
  File "/usr/lib/python3/dist-packages/ansiblelint/ __main__.py", line 39, in <module>
    from ansiblelint import cli
  File "/usr/lib/python3/dist-packages/ansiblelint/cli.py", line 29, in <module>
    from ansiblelint.yaml_utils import clean_json
  File "/usr/lib/python3/dist-packages/ansiblelint/yaml_utils.py", line 31, in <module>
    from ansiblelint.utils import Task
  File "/usr/lib/python3/dist-packages/ansiblelint/utils.py", line 41, in <module>
    from ansible.parsing.yaml.constructor import AnsibleConstructor, AnsibleMapping
ModuleNotFoundError: No module named 'ansible.parsing.yaml.constructor'

```

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/markstos/32/9706_2.png) [@markstos](https://forum.ansible.com/u/markstos)\
**Post date:** [November 19, 2025, 2:38pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/8 "2025-11-19T14:38:32Z")

</div>

@Victor_Sudakov Another option to make sure you get versions that match is to use a Python package manager instead of the Ubuntu package manager.

I recommend `uv` which can be much faster than `pip` and also easy to use.

To install `uv`

```auto
curl -LsSf https://astral.sh/uv/install.sh | sh

```

From there, you can use `uv run` to run either command. It will download and cache them at ~/.cache/uv without polluting your system packages:

```auto
uvx ansible --version
uvx ansible-lint --version 

```

`uv` has options to permanently install the packages at a path as well.

> **[uv](https://docs.astral.sh/uv/)**
>
> uv is an extremely fast Python package and project manager, written in Rust.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [November 19, 2025, 3:32pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/9 "2025-11-19T15:32:05Z")

</div>

The underlying issue is that the ppa provides package names that override those that available in the ubuntu repos.

As a result, when you install `ansible-lint` from the ubuntu repo, it has a dep on `ansible`/`ansible-core` and is pulling that from the PPA.

However, the version of `ansible-lint` from the ubuntu repos is not compatible with the version of `ansible-core` from the PPA.

Basically, in `ansible-core` 2.19+ this import no longer exists: `ansible.parsing.yaml.constructor`

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 19, 2025, 5:15pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/10 "2025-11-19T17:15:41Z")

</div>

@sivel Why is ansible-lint not in the ansible PPA and are there any chances to have it included there?

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 19, 2025, 5:22pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/11 "2025-11-19T17:22:01Z")

</div>

Thank you @markstos , I’ll give uv a try though I’d strongly prefer to have ansible and ansible-lint installed for all local users and not just myself (which apt does).

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/markstos/32/9706_2.png) [@markstos](https://forum.ansible.com/u/markstos)\
**Post date:** [November 19, 2025, 5:30pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/12 "2025-11-19T17:30:00Z")

</div>

I agree that a system package would be ideal.

You can use `uv` to install the package at the system-level as well, but there’s chance that it could conflict with other packages installed via the Ubuntu package manager.

```auto
uv pip install --system ansible-lint

```

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 19, 2025, 6:12pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/13 "2025-11-19T18:12:58Z")

</div>

> [@Victor\_Sudakov](#):
>
> @sivel Why is ansible-lint not in the ansible PPA and are there any chances to have it included there?

For the why, you could also ask: why should it? Someone would have to maintain that, and so far nobody stepped up to do it.

The main problem with ansible-lint is that it has a lot of dependencies. If you package ansible-core, [which has a very low number of dependencies](https://github.com/ansible/ansible/blob/devel/requirements.txt) out of which several are already packaged by most OSes, you can focus on packaging ansible-core and maybe 1-2 other packages. If you look at [ansible : “Ansible” team](https://launchpad.net/~ansible/+archive/ubuntu/ansible), you can see it’s `resolvelib` for some Ubuntu versions, but nothing else.

Now if you want to package ansible-lint, you’ll likely find out that many of its (transitive) transitive dependencies are not yet packaged, or not in the versions ansible-lint requires. Then you have to start packaging these as well, and if these clash with packages Ubuntu already has (which will likely happen, considering that Ubuntu itself has an older version of ansible-lint), you end up in dependency hell and are making the problem you’re seeing here with ansible-lint and ansible-core a lot worse for many other programs that depend on the other dependencies.

That’s why I wouldn’t want to package it in a PPA.

But maybe I’m wrong, and it’s not that bad. If you want to know how hard packaging ansible-lint actually is, you need to compare the list here: [ansible-lint/pyproject.toml at 43e758bad47344f1ce7b699c0020299f486a8026 · ansible/ansible-lint · GitHub](https://github.com/ansible/ansible-lint/blob/43e758bad47344f1ce7b699c0020299f486a8026/pyproject.toml#L34-L55) to Ubuntu’s package repo and the versions shown there. See whether you can find all the packages, and whether their versions are new enough.

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 20, 2025, 10:00am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/14 "2025-11-20T10:00:49Z")

</div>

@markstos I have already tried this trick installing ansible-lint from pip or pipx alongside with ansible from the PPA, it did not work because in this case ansible-lint refused to see the installed ansible collections.

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 20, 2025, 10:07am UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/15 "2025-11-20T10:07:16Z")

</div>

It is very unfortunate that ansible-lint is such a headache. I somehow felt it was an integral part of the ansible toolset (like ansible-console etc) and therefore belonged very well with ansible’s other utilities, it is a pity it is not the case.

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 20, 2025, 3:27pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/16 "2025-11-20T15:27:33Z")

</div>

> I recommend `uv` which can be much faster than `pip` and also easy to use.

Looks unfriendly at first glance:

```auto
$ uvx ansible-playbook --version
  × No solution found when resolving tool dependencies:
  ╰─▶ Because ansible-playbook was not found in the package registry and you require ansible-playbook, we can conclude that your requirements are unsatisfiable.
$ uvx ansible-console
  × No solution found when resolving tool dependencies:
  ╰─▶ Because ansible-console was not found in the package registry and you require ansible-console, we can conclude that your requirements are unsatisfiable.

```

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/markstos/32/9706_2.png) [@markstos](https://forum.ansible.com/u/markstos)\
**Post date:** [November 20, 2025, 3:33pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/17 "2025-11-20T15:33:59Z")

</div>

The uvx shortcut works when the command name exactly matches a package name.

`uv` can still be used to install packages in the usual way, just like pip. I recommend checking the uv docs to see the options.

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 20, 2025, 3:40pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/18 "2025-11-20T15:40:01Z")

</div>

Having to run each time something like `uvx --from=ansible-core ansible-console ...` is still not friendly 🙂

---

<div class="post-metadata">

**Author:** ![Victor\_Sudakov](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/victor_sudakov/32/9830_2.png) [@Victor\_Sudakov](https://forum.ansible.com/u/Victor_Sudakov)\
**Post date:** [November 20, 2025, 3:45pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/19 "2025-11-20T15:45:04Z")

</div>

And still has the same problem I saw when I tried to install ansible-lint from pip/pipx: it does not see the collections

```auto
$ uvx ansible-lint workstation.yml
WARNING Listing 1 violation(s) that are fatal
syntax-check[unknown-module]: couldn't resolve module/action 'community.general.locale_gen'. This often indicates a misspelling, missing collection, or incorrect module path.
workstation.yml:20:7

```

There is a collection path problem somewhere. The “community.general” collection is of course present in the system

```auto
$ ansible-galaxy collection list | grep general
community.general 11.4.1

```

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/markstos/32/9706_2.png) [@markstos](https://forum.ansible.com/u/markstos)\
**Post date:** [November 20, 2025, 3:54pm UTC](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859/20 "2025-11-20T15:54:16Z")

</div>

You can use `uv` or `pip` to install Python packages, after which they are installed on your machine, and you can the commands without any prefix, like normal.

> And still has the same problem I saw when I tried to install ansible-lint from pip/pipx: it does not see the collections

Then I recommend installing the packages normally and setting up collections\_paths in your ansible.cfg to point to your path where your collections are stored:

> **[Ansible By Example - Expert Ansible Tutorials & Resources](https://www.ansiblepilot.com/articles/where-are-ansible-collections-installed)**
>
> Learn Ansible automation with comprehensive tutorials, practical examples, and expert resources from Luca Berton.

[Next page](https://forum.ansible.com/t/ansible-lint-in-the-ansible-ppa-is-broken/44859.md?page=2)
