
Compendium of Knowledge and Helpful Things - Unattended Upgrades
Stay secure, install and configure `unattended-upgrades`
I run a pi-hole on my home network (yes, your Wifi is a home network). But this means that I need to keep the Raspberry Pi up to date as well.
Previously I have used this script:
#!/bin/sh
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get autoremove -y
sudo apt-get autoclean -y
sudo /usr/local/bin/pihole -up
sudo /usr/local/bin/pihole -g
sudo reboot
And this is run at 3am every Sunday morning by this command (via cron):
sh /home/pi/update.sh > /home/pi/logs/cronlog 2>&1
But reading the Register there is a box out extolling the benefits of unattended-upgrades
. A quick search turned up the It4home - Installing and Configuring Unattended Upgrades on Raspberry Pi article. An excellent guide to setup.
My Sunday morning script is now down to:
#!/bin/sh
sudo /usr/local/bin/pihole -up
sudo /usr/local/bin/pihole -g
sudo reboot