# Command line for System Upgrades

**URL:** <https://forum.ansible.com/t/command-line-for-system-upgrades/23311>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [December 21, 2016, 4:30pm UTC](https://forum.ansible.com/t/command-line-for-system-upgrades/23311 "2016-12-21T16:30:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rick\_Belscher](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@Rick\_Belscher](https://forum.ansible.com/u/Rick_Belscher)\
**Post date:** [December 21, 2016, 4:30pm UTC](https://forum.ansible.com/t/command-line-for-system-upgrades/23311/1 "2016-12-21T16:30:27Z")

</div>

I am working on patching multiple ubuntu systems and have run into an issue and I am unable to find a solution. I’m pretty new to ansible so not sure if it’s possible to respond to prompts by OS.

Here is what I run now:

ansible \<host\_group\> -m shell -s -a “apt-get upgrade -y” -u -k -K

This works for apt-get update  
apt-get install --only-upgrade

This issue on the upgrade on these systems:

1. There are 5 points during the upgrade that require response with enter on a y/n answer and a No prompt for PAM.

Is there a way do do this via command line.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [December 22, 2016, 5:35pm UTC](https://forum.ansible.com/t/command-line-for-system-upgrades/23311/2 "2016-12-22T17:35:05Z")

</div>

I would try using the apt module first. If that does not deal with it as you want it to, I would use debconf + apt or if you insist on using direct commands, the expect module.
