Автоматические обновления не обновляют дополнительный репозиторий

Автоматические обновления не обновляют дополнительный репозиторий. Для других пакетов обновление работает. Это настройки, которые я сделал:

> 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";
> 
>

И здесь:

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

Но также через некоторое время есть некоторые пакеты, которые не обновлялись (они также не удерживаются):

> 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]

Эти пакеты взяты из дополнительного репозитория:

> /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

Пожалуйста, дайте мне знать, как полностью будут работать автоматические обновления.

Заранее благодарим.

0
задан 23 October 2020 в 13:48

1 ответ

Автоматические обновления используют формат "Происхождение:Раздел"; Вот пример.

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

Итак, нам нужно:

  1. Найти поле Origin,
  2. Найти поле Section, а затем
  3. обернуть их в правильном формате.

Шаг 1: Найдите URL-адрес источника, который вы хотите добавить. Он находится в ваших подходящих источниках. Он находится внутри вашего файла /etc/apt/sources.list.d/icinga-main-focal.list URL-адрес выглядит примерно так...

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

Шаг 2: Найдите соответствующий выпуск файл в вашей системе для 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

Шаг 3: Используйте grep, чтобы найти поле «Происхождение».

$ 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

Шаг 4: Найдите поле «Раздел».

Вернитесь к URL-адресу на шаге 1. Раздел — это просто первое слово после 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

Шаг 5: Соберите все вместе и правильно отформатируйте. Напомним, что формат: "Происхождение:Раздел";. Кавычки и завершающая точка с запятой являются важными элементами форматирования.

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";

Шаг 6: добавьте строку в правильный раздел /etc/apt/apt.conf.d/50unattended-upgrades.

Протестируйте: запустите sudo unattended-upgrade, затем проверьте файл журнала в var/log/unattended-upgrades/unattended-upgrades.log, чтобы убедиться, что он работает без ошибок и что ваш источник был правильно включен.

1
ответ дан 23 October 2020 в 11:29

Другие вопросы по тегам:

Похожие вопросы: