diff --git a/README.md b/README.md index 1664d4d..a92c2e3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ apt_reset_source_list: no # reset the /etc/apt/sources.list to the defau apt_cache_valid_time: 3600 # Time (in seconds) the apt cache stays valid apt_install_recommends: no # whether or not to install the "recommended" packages apt_install_suggests: no # whether or not to install the "suggested" packages +apt_autoremove: yes # remove packages that are no longer needed for dependencies +apt_autoclean: yes # remove .deb files for packages no longer on your system ``` Remark: Beware that setting `apt_install_recommends` and `apt_install_suggests` to `yes` may heavily increase the apt-requirements (and hence disk usage). You should proceed cautiously changing these. diff --git a/defaults/main.yml b/defaults/main.yml index 4994a27..3a84110 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,3 +4,5 @@ apt_reset_source_list: no # reset the /etc/apt/sources.list to the defau apt_cache_valid_time: 3600 # Time (in seconds) the apt cache stays valid apt_install_recommends: no # whether or not to install the "recommended" packages apt_install_suggests: no # whether or not to install the "suggested" packages +apt_autoremove: yes # remove packages that are no longer needed for dependencies +apt_autoclean: yes # remove .deb files for packages no longer on your system diff --git a/tasks/main.yml b/tasks/main.yml index f7b7c89..bb3946c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,9 +16,11 @@ - name: APT | Remove packages that are no longer needed for dependencies shell: apt-get -y autoremove + when: apt_autoremove - name: APT | Remove .deb files for packages no longer on your system shell: apt-get -y autoclean + when: apt_autoclean - name: APT | Update the general configuration (/etc/apt/apt.conf.ds/10general) template: