# Apt deb --yes option

**URL:** <https://forum.ansible.com/t/apt-deb-yes-option/8796>\
**Category:** Get Help\
**Tags:** apt, playbook\
**Created:** [September 26, 2024, 2:23pm UTC](https://forum.ansible.com/t/apt-deb-yes-option/8796 "2024-09-26T14:23:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spontarelliam](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@spontarelliam](https://forum.ansible.com/u/spontarelliam)\
**Post date:** [September 26, 2024, 2:23pm UTC](https://forum.ansible.com/t/apt-deb-yes-option/8796/1 "2024-09-26T14:23:42Z")

</div>

I want to install vscode from a deb file on all of our machines. Installing manually looks like this:

```auto
apt install --yes ./code_1.93.1-1726079302_amd64.deb

```

The --yes is needed because installation prompts a yes/no question.

I can’t figure out how to accomplish this same task through Ansible. It seems that ansible’s apt allows the inclusions of dpkg\_options, but those options are apparently different from apt’s options, and there is no ‘–yes’ option in dpkg.

```auto
- name: VSCode
      apt:
        deb: './code_1.93.1-1726079302_amd64.deb'
        dpkg_options: "yes"

```

This playbook returns:

```auto
TASK [VSCode] ***************************************************************************************************************************************************
fatal: [10.0.0.64]: FAILED! => {"changed": false, "msg": "Dependency is not satisfiable: libglib2.0-0 (>= 2.37.3)\n"}

```

I appreciate the help.

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [September 26, 2024, 9:24pm UTC](https://forum.ansible.com/t/apt-deb-yes-option/8796/2 "2024-09-26T21:24:51Z")

</div>

Does manual installation from the shell work? Because, this error:

```auto
Dependency is not satisfiable: libglib2.0-0 (>= 2.37.3)

```

indicate something entirely different (bad dependency) instead of prompt not being answered. When prompt is not answered, it usually hangs.

On the other hand, the prompt displayed is most likely not from the `apt` or `dpkg` but from the pre install script inside a package (EULA acceptance?). That’s why `--yes` has no effect. I have seen this in some Microsoft packages, not sure about VS Code.

The good thing about Microsoft packages is that you can define environment variable to automatically accept EULA (unattended install) which can be done in Ansible like so:

```auto
- name: "VSCode"
  apt:
    deb: './code_1.93.1-1726079302_amd64.deb'
  environment:
    ACCEPT_EULA: "y"

```

It is possible that for VS Code the environment variable has different name so please consult with the VS Code documentation.
