# Ansible-lint shouting about apt state:latest

**URL:** <https://forum.ansible.com/t/ansible-lint-shouting-about-apt-state-latest/10928>\
**Category:** Get Help\
**Tags:** ansible-lint\
**Created:** [November 15, 2024, 7:35am UTC](https://forum.ansible.com/t/ansible-lint-shouting-about-apt-state-latest/10928 "2024-11-15T07:35:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilian-granqvist](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lilian-granqvist/32/4731_2.png) [@lilian-granqvist](https://forum.ansible.com/u/lilian-granqvist)\
**Post date:** [November 15, 2024, 7:35am UTC](https://forum.ansible.com/t/ansible-lint-shouting-about-apt-state-latest/10928/1 "2024-11-15T07:35:28Z")

</div>

❯ ansible-lint --version  
ansible-lint 24 using ansible-core:2.16.12 ansible-compat:24.9.0 ruamel-yaml:0.18.5 ruamel-yaml-clib:0.2.7

Is there a way to acknowledge the warning of using state:latest without using only\_upgrade flag ?

using this as a full system upgrade command which wasn’t explored in the linter webpage, but is the recommended way to do full system upgrade in ansible doc

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [November 15, 2024, 12:58pm UTC](https://forum.ansible.com/t/ansible-lint-shouting-about-apt-state-latest/10928/2 "2024-11-15T12:58:15Z")

</div>

You can skip this check, eg in `.ansible-lint`:

```yaml
---
skip_list:
  - package-latest

```

Or just for the one task:

```yaml
- name: Latest foo present # noqa package-latest
  apt:
    pkg:
      - foo
    state: latest

```

---

<div class="post-metadata">

**Author:** ![jiholland](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jiholland/32/11273_2.png) [@jiholland](https://forum.ansible.com/u/jiholland)\
**Post date:** [November 15, 2024, 12:59pm UTC](https://forum.ansible.com/t/ansible-lint-shouting-about-apt-state-latest/10928/3 "2024-11-15T12:59:20Z")

</div>

Yes.  
In the [configuration file](https://ansible.readthedocs.io/projects/lint/configuring/#ansible-lint-configuration) for ansible-lint:

```yaml
$ cat .config/ansible-lint.yml
---
skip_list
  - package-latest

```

Or at task level with noqa:

```yaml
    - name: Install.
    # noqa: package-latest
      ansible.builtin.apt:
        name: apache2
        state: latest

```

---

<div class="post-metadata">

**Author:** ![lilian-granqvist](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lilian-granqvist/32/4731_2.png) [@lilian-granqvist](https://forum.ansible.com/u/lilian-granqvist)\
**Post date:** [November 15, 2024, 1:18pm UTC](https://forum.ansible.com/t/ansible-lint-shouting-about-apt-state-latest/10928/4 "2024-11-15T13:18:20Z")

</div>

Thank you for the answers!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [December 15, 2024, 1:19pm UTC](https://forum.ansible.com/t/ansible-lint-shouting-about-apt-state-latest/10928/5 "2024-12-15T13:19:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
