Add apt.upgrade() convenience function

This commit is contained in:
Lance Edgar 2020-09-29 17:59:21 -05:00
parent c9aebd84e9
commit c67cc74d3d

View file

@ -67,6 +67,16 @@ def add_source(c, entry):
update(c) update(c)
def upgrade(c, frontend='noninteractive'):
"""
Perform an ``apt-get upgrade`` operation.
"""
options = ''
if frontend == 'noninteractive':
options = '--option Dpkg::Options::="--force-confdef" --option Dpkg::Options::="--force-confold"'
c.sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {} upgrade'.format(frontend, options))
def dist_upgrade(c, frontend='noninteractive'): def dist_upgrade(c, frontend='noninteractive'):
""" """
Perform a full ``apt-get dist-upgrade`` operation. Perform a full ``apt-get dist-upgrade`` operation.