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

HowTo – Unattended Upgrades for Jenkins

2 thoughts on “HowTo – Unattended Upgrades for Jenkins

  • December 19, 2017 at 1:02 pm
    Permalink

    The origin is now “jenkins.io:binary”, could you please update the post?

    Reply
    • December 19, 2017 at 2:21 pm
      Permalink

      Thanks for the hint, done! 🙂

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.