Skip to content

GitLab CE Package Unattended Upgrade

Prerequisite

To be able to do 'Unattended Upgrades' package unattended-upgrades to be installed.

This package installs security updates automatically. (See wiki)

Install the package

apt-get install unattended-upgrades

Configure the package

dpkg-reconfigure -plow unattended-upgrades

Set e-mail and auto reboot after upgrade

Edit file /etc/apt/apt.conf.d/50unattended-upgrades.

editor /etc/apt/apt.conf.d/50unattended-upgrades

Unattended upgraded config for gitlab-ce package.

Edit file /etc/apt/apt.conf.d/50unattended-upgrades and add or merge the content below.

// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
    "${distro_id}:${distro_codename}-security";
    "${distro_id}:${distro_codename}-updates";
    "*packages.gitlab.com/gitlab/gitlab-ce:${distro_codename}";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";
};


# This ia just a opartial section.
Unattended-Upgrade::Origins-Pattern {
        // Codename based matching:
        // This will follow the migration of a release through different
        // archives (e.g. from testing to stable and later oldstable).
        "o=Debian,n=jessie";
        "o=Debian,n=jessie-updates";
//        "o=Debian,n=jessie-proposed-updates";
        "o=Debian,n=jessie,l=Debian-Security";

        // AvO: added for GitLab
        "origin=${distro_id},archive=${distro_codename}-security";
        "origin=https://packages.gitlab.com/gitlab/gitlab-ce,archive=${distro_codename}";
}

For testing upgrades execute the next command.

unattended-upgrade --debug --dry-run