It is often recommended to install updates before installing other packages, we can create a Cron job that will run these commands on a daily basis.

List existing Cron jobs

crontab -l

Create a new Cron job

crontab -e

Now add this line to the crontab which will run daily at midnight

0 0 * * * sudo apt update && sudo apt --yes upgrade