# Apt module pass arguments

**URL:** <https://forum.ansible.com/t/apt-module-pass-arguments/38138>\
**Category:** Ansible Project\
**Created:** [June 21, 2023, 9:25am UTC](https://forum.ansible.com/t/apt-module-pass-arguments/38138 "2023-06-21T09:25:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_Rijken](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jeroen\_Rijken](https://forum.ansible.com/u/Jeroen_Rijken)\
**Post date:** [June 21, 2023, 9:25am UTC](https://forum.ansible.com/t/apt-module-pass-arguments/38138/1 "2023-06-21T09:25:09Z")

</div>

Hi,

Is it currently possible to pass apt options to the apt module? The dpkg\_options are only for dpkg, I’d like to pass apt specific options like so:

`apt-get -o Dir::Etc::SourceList=/tmp/sources.list -o Dir::Etc::SourceParts=/nonexistent -o Dir::State::Lists=/tmp/lists/ update`

This doesn’t work because the apt module only supports dpkg options:

```auto

- name: Parallel download packages | Download all required packages in parallel | Update cache
ansible.builtin.apt:
update_cache: true
dpkg_options: "Dir::Etc::SourceList=/tmp/sources.list,Dir::Etc::SourceParts=/nonexistent,Dir::State::Lists=/tmp/lists/"
when:
- ansible_facts['distribution_major_version'] != "22"

```

Kind regards, Jeroen Rijken

---

<div class="post-metadata">

**Author:** ![Andrew\_Latham](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Andrew\_Latham](https://forum.ansible.com/u/Andrew_Latham)\
**Post date:** [June 21, 2023, 2:51pm UTC](https://forum.ansible.com/t/apt-module-pass-arguments/38138/2 "2023-06-21T14:51:42Z")

</div>

Jeroen

There are several issues related and a PR at [https://github.com/ansible/ansible/pull/76632](https://github.com/ansible/ansible/pull/76632) that you may want to look at. Feel free to do a search of [https://github.com/ansible/ansible/issues](https://github.com/ansible/ansible/issues) for related topics.
