1

Unattended upgrades doesn't upgrade additional repository. For other packages the upgrade does work. This are the settings which I made:

> cat  /etc/apt/apt.conf.d/50unattended-upgrades // Automatically
> upgrade packages from these (origin:archive) pairs // // Note that in
> Ubuntu security updates may pull in new dependencies // from
> non-security sources (e.g. chromium). By allowing the release //
> pocket these get automatically pulled in.
> Unattended-Upgrade::Allowed-Origins {
>         "${distro_id}:${distro_codename}";
>         "${distro_id}:${distro_codename}-security";
>         // Extended Security Maintenance; doesn't necessarily exist for
>         // every release and this system may not have it installed, but if
>         // available, the policy for updates is such that unattended-upgrades
>         // should also install from here by default.
>         "${distro_id}ESMApps:${distro_codename}-apps-security";
>         "${distro_id}ESM:${distro_codename}-infra-security";
>         "${distro_id}:${distro_codename}-updates";
> 
>

And here:

>  cat /etc/apt/apt.conf.d/20auto-upgrades
> APT::Periodic::Update-Package-Lists "1";
> APT::Periodic::Unattended-Upgrade "1";

But also after some time there are some packages which hasn't updated (there are also not hold):

> apt list --upgradable Listing... Done icinga2-bin/icinga-focal
> 2.12.1-1.focal amd64 [upgradable from: 2.12.0-1.focal] icinga2-common/icinga-focal 2.12.1-1.focal all [upgradable from:
> 2.12.0-1.focal] icinga2-doc/icinga-focal 2.12.1-1.focal all [upgradable from: 2.12.0-1.focal] icinga2/icinga-focal 2.12.1-1.focal
> amd64 [upgradable from: 2.12.0-1.focal]

These packages are from an additional repository:

> /etc/apt/sources.list.d# ll total 12 drwxr-xr-x 2 root root 4096 Sep
> 14 08:27 ./ drwxr-xr-x 7 root root 4096 Sep 14 08:27 ../
> -rw-r--r-- 1 root root   57 Sep 14 08:27 icinga-main-focal.list

Please let me know how will the unattended Upgrades completely work.

Thanks in advance.

1 Answer 1

6

Unattended upgrades uses the format "Origin:Section"; Here's an example.

//    "${distro_id}:${distro_codename}-updates";
Origin  = ${distro_id}
Section = ${distro_codename}-updates

So we need to:

  1. Find the Origin field,
  2. Find the Section field, then
  3. Wrap those in the correct formatting.

Step 1: Find the URL of the source that you want to add. It's located in your apt sources. It's inside your file /etc/apt/sources.list.d/icinga-main-focal.list The URL looks something like this...

deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse
  ...or...
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
  ...or...
deb https://downloads.plex.tv/repo/deb/ public main

Step 2: Find the corresponding Release file in your system for the URL.

http://security.ubuntu.com/ubuntu focal-security
  ...becomes...
/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_focal-security_InRelease


http://dl.google.com/linux/chrome/deb/ stable
  ...becomes...
/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_InRelease


https://downloads.plex.tv/repo/deb/ public
  ...becomes...
/var/lib/apt/lists/downloads.plex.tv_repo_deb_dists_public_Release

Step 3: Use grep to find the "Origin" field.

$ grep Origin /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_focal-security_InRelease
Origin: Ubuntu

$ grep Origin /var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_InRelease
Origin: Google LLC

$ grep Origin /var/lib/apt/lists/downloads.plex.tv_repo_deb_dists_public_Release
Origin: Artifactory

Step 4: Find the Section field.

Go back to the URL in Step 1. The Section is simply the first word after the URL.

http://security.ubuntu.com/ubuntu focal-security
  ...becomes...
Section: focal-security


http://dl.google.com/linux/chrome/deb/ stable
  ...becomes...
Section: stable


https://downloads.plex.tv/repo/deb/ public
  ...becomes...
Section: public

Step 5: Put it all together, and format it properly. Recall that the format is: "Origin:Section";. The quotes and the trailing semicolon are essential formatting elements.

http://security.ubuntu.com/ubuntu focal-security
Origin: Ubuntu
Section: focal-security
Formatted line for Unattended Upgrades: "Ubuntu:focal-security";

http://dl.google.com/linux/chrome/deb/ stable
Origin: Google LLC
Section: stable
Formatted line for Unattended Upgrades: "Google LLC:stable";

https://downloads.plex.tv/repo/deb/ public
Origin: Artifactory
Section: Public
Formatted line for Unattended Upgrades: "Artifactory:public";

Step 6: Add the line to the correct section of /etc/apt/apt.conf.d/50unattended-upgrades.

Test it: Run sudo unattended-upgrade, then check the logfile at var/log/unattended-upgrades/unattended-upgrades.log to ensure that it ran without error and that your source was properly included.

1
  • 1
    Thank you very much for your detailed and helpful answer. It works now :)
    – tom
    Oct 23, 2020 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.