def uptodate_index(quiet=True, max_age=86400):

    from fabtools.require import file as require_file
    require_file('/etc/apt/apt.conf.d/15fabtools-update-stamp', contents='''\
APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/fabtools-update-success-stamp 2>/dev/null || true";};
''', use_sudo=True)

    if system.time() - last_update_time() > _to_seconds(max_age):
        update_index(quiet=quiet)
Require an up-to-date package index.
dataset/ETHPy150Open ronnix/fabtools/fabtools/require/deb.py/uptodate_index