AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1286222
Accepted
tom
tom
Asked: 2020-10-24 02:48:44 +0800 CST2020-10-24 02:48:44 +0800 CST 2020-10-24 02:48:44 +0800 CST

无人值守升级不会升级其他存储库

  • 772

无人值守升级不会升级其他存储库。对于其他软件包,升级确实有效。这是我所做的设置:

> 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

请让我知道无人值守升级将如何完全工作。

提前致谢。

package-management unattended-upgrades
  • 1 1 个回答
  • 1281 Views

1 个回答

  • Voted
  1. Best Answer
    user535733
    2020-10-24T03:29:18+08:002020-10-24T03:29:18+08:00

    无人值守升级使用以下格式"Origin:Section";示例。

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

    所以我们需要:

    1. 找到 Origin 字段,
    2. 找到 Section 字段,然后
    3. 用正确的格式包装它们。

    第 1 步:找到要添加的源的 URL。它位于您的 apt 来源中。它在您的文件/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 对应的 Release 文件。

    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 查找“Origin”字段。

    $ 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 步:找到“部分”字段。

    回到步骤 1 中的 URL。Section 只是 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步:将它们放在一起,并正确格式化。回想一下格式是:"Origin:Section";. 引号和尾随分号是必不可少的格式元素。

    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以确保它运行时没有错误,并且您的源代码已正确包含。

    • 5

相关问题

  • 如何从命令行判断机器是否需要重新启动?

  • 有没有办法重置所有包/源并从头开始?

  • 如何回滚到 PHP 5.2?

  • 包管理器之间有什么区别?

  • 如何启用自动更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve