15

Say I recently installed unattended-upgrades via:

sudo apt-get install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades -y

Does unattended-upgrades also include apt-get autoremove?

Or should I add a weekly cronjob atop the unattended-upgrades layer to make sure dependencies of deleted packages are removed as well, via crontab -e and then:

0 0 * * 0 apt-get autoremove -y

Note: Feel free to mention similar apt concepts besides autoremove if these are needed.

20

Whether or not unattended-upgrades will perform the cleanup (auto remove) is controlled by the Unattended-Upgrade::Remove-Unused-Dependencies setting in /etc/apt/apt.conf.d/50unattended-upgrades. Set it as follows to enable the cleanup -- and you should be able to remove the explicit autoremove cron-job:

Unattended-Upgrade::Remove-Unused-Dependencies "true";

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.