Skip to main content

Update Ubuntu on a schedule

·81 words·1 min
Author
Ian Blockmans
I make things and also virtual things

how do i sudo unattended
#

We can achieve this with the power of sudoers. By adding ian ALL=(ALL:ALL) NOPASSWD:/home/ian/update.sh to /etc/sudoers.d/update I can now execute the update script in the home directory with sudo privileges without a password from the user ian.

the update script
#

just a simple apt update and apt upgrade with -y for unattended execution.

#!/bin/bash
apt update
apt upgrade -y

now to schedule
#

just a simple n8n automation to run the script every week.

Related