- hosts: 127.0.0.1 connection: local gather_facts: yes become: true tasks: - name: update respository index ansible.builtin.apt: update_cache: yes # upgrade: safe upgrade: full - name: Run the equivalent of "apt clean" ansible.builtin.apt: clean: yes