I find myself having to allow updates in the AppCenter two times a day. Is there a way to set AppCenter to automatically update in the background without asking me?
As of elementary OS 5.1, packages in AppCenter are just APT packages (unless you've also set up your AppCenter to work with Flatpak packages).
Auto-update APT packages using a CRON job
You can auto-update all your APT packages on a schedule using a CRON job:
- Open root's crontab file (we use root because the APT commands require root access):
sudo crontab -e
- Append this line to the end of the crontab file:
0 7,19 * * * (apt update && apt -y upgrade) > /dev/null
Note the following:
- This command is set to run daily at 7am and 7pm. If you need guidance with writing CRON expressions, search online for a CRON expression generator such as this.
- The command will run APT as root to update and upgrade your packages. Any output (e.g. information, warnings, or errors) from these commands are discarded.
With this solution, you will still see update notifications from App Center throughout the day -- but they will be installed automatically on the schedule you set.