Debian で UnattendedUpgrades を使用して特定のパッケージが更新されないようにブラックリストに追加

Debian で UnattendedUpgrades を使用して特定のパッケージが更新されないようにブラックリストに追加

無人アップグレードにより、Debian 12の一部のパッケージが自動的に更新されるのを防ぎます。

/etc/apt/apt.conf.d/50unattended-upgradesデフォルトのブラックリスト部分は次のとおりです。

// Python regular expressions, matching packages to exclude from upgrading
Unattended-Upgrade::Package-Blacklist {
    // The following matches all packages starting with linux-
//  "linux-";

    // Use $ to explicitely define the end of a package name. Without
    // the $, "libc6" would match all of them.
//  "libc6$";
//  "libc6-dev$";
//  "libc6-i686$";

    // Special characters need escaping
//  "libstdc\+\+6$";

    // The following matches packages like xen-system-amd64, xen-utils-4.1,
    // xenstore-utils and libxenstore3.0
//  "(lib)?xen(store)?";

    // For more information about Python regular expressions, see
    // https://docs.python.org/3/howto/regex.html
};

特定のパッケージバージョンへのアップグレードをブラックリストに追加したい場合

      - openvpn=2.6.3-1+deb12u1
      - docker-ce=5:24.0.0-1~debian.12~bookworm
      - docker-ce-cli=5:24.0.0-1~debian.12~bookworm
      - containerd.io
      - docker-buildx-plugin
      - docker-compose-plugin

// "linux-";コメントを外して次に置き換えることでこれを行うことはできますか?

"openvpn-";
"docker-";
"containerd.io$";

また、構成ファイル内のこの行の意味が混乱しています。すべてのパッケージを更新しますか、またはセキュリティ関連のパッケージのみを更新しますか?セキュリティパッケージを自動的に更新したいです。

    "origin=Debian,codename=${distro_codename},label=Debian";

上記の全内容:

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).
        // Software will be the latest available for the named release,
        // but the Debian release itself will not be automatically upgraded.
//      "origin=Debian,codename=${distro_codename}-updates";
//      "origin=Debian,codename=${distro_codename}-proposed-updates";
        "origin=Debian,codename=${distro_codename},label=Debian";
        "origin=Debian,codename=${distro_codename},label=Debian-Security";
        "origin=Debian,codename=${distro_codename}-security,label=Debian-Security";

        // Archive or Suite based matching:
        // Note that this will silently match a different release after
        // migration to the specified archive (e.g. testing becomes the
        // new stable).
//      "o=Debian,a=stable";
//      "o=Debian,a=stable-updates";
//      "o=Debian,a=proposed-updates";
//      "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
};

ベストアンサー1

おすすめ記事