Does unattended-upgrades also include apt-get autoremove?
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";
In addition to Mikhail's suggestion, it is also useful to autoremove unused kernel packages. This will keep the /boot/
partition from filling up on some Ubuntu systems. A full /boot partition can lead to issues.
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";