Howdy people,
in this HowTo I want to show you how to upgrade Jenkins automatically via unattended-upgrades.
Maybe you know the unattended-upgrades package.
Especially for security updates this package can be useful and important.
For example, an important update for Apache 2.4 came out in the night – and my server just installed it automatically.
Nothing is more convenient to wake up, check your iPhone and see that the security updates are installed.
First install unattended-upgrades
sudo apt-get update && sudo apt-get install unattended-upgrades
Cofiguration
Now you need to add the file /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1";
Now the unattended upgrades are enabled.
Next edit the unattended-upgrades config in /etc/apt/apt.conf.d/50unattended-upgrades
To enable Jenkins add this entry to Allowed-Origins
"jenkins.io:binary";
Mine looks like this
Unattended-Upgrade::Allowed-Origins { "${distro_id}:${distro_codename}-security"; "${distro_id}:${distro_codename}-updates"; "jenkins.io:binary"; // "${distro_id}:${distro_codename}-proposed"; // "${distro_id}:${distro_codename}-backports"; };
Pro tip: Email the result 🙂
When you have mailx installed, you can deliver an E-Mail to any configured address, containing the results.
Simply add or uncomment
Unattended-Upgrade::Mail "[email protected]";
Thanks for reading – looking forward to hearing from you 🙂
Cheers,
Tim
The origin is now “jenkins.io:binary”, could you please update the post?
Thanks for the hint, done! 🙂