テーマ: apt
-
ロールバックの手段を保ちながら Debian と Ubuntu を次のメジャーリリースへアップグレードする
Ubuntu の do-release-upgrade と、ソースリストを手動で変更してからアップグレードする Debian の手順は、どちらも完全なバックアップと、アップグレード中に SSH セッションが切れた場合に備えたコンソールへの代替アクセスを前提とする。Debian 自身のリリースノートは、完全なアップグレードの前に最小限のアップグレードを行うことを推奨している。
-
現在の方法でサードパーティーAPTリポジトリを追加する:deb822 .sourcesファイルとSigned-Byキーリング
apt-keyは非推奨である。署名付きサードパーティーリポジトリを追加する対応済みの方法は、/etc/apt/keyrings内のキーリングファイルをSigned-Byオプションで参照することだ。従来の1行形式、またはDebian 12/13と現在のUbuntuリリースが解釈できる新しいdeb822 .sources形式で記述する。
-
An internal package mirror or cache for Linux clients: apt-cacher-ng and dnf's reposync
Apt-Cacher NG caches Debian/Ubuntu packages on demand behind an HTTP proxy setting, while dnf's reposync plugin makes a full local copy of a chosen RPM repository. Both cut repeated downloads without weakening client-side signature verification, which stays on regardless of where the bytes came from.
-
apt-get, dpkg, dnf and zypper exit codes: when 100 means updates, not failure
apt-get uses a flat 0-success/100-error split; dpkg distinguishes a failed check (1) from a fatal usage or system error (2); dnf's check-update repurposes 100 to mean updates ARE available, not an error; and zypper defines a whole range, 100-107, of informational (non-error) exit codes for conditions like a pending reboot (though 104, package not found, and 105, interrupted, mean the action did not happen). Reading any of these as a plain success/fail boolean loses real information.
-
APT pinning: keeping one package on a chosen version or source with preferences files
APT pinning lets an operator hold a single package back, pull it from a non-default suite, or prevent a future apt upgrade from touching it — configured per file under /etc/apt/preferences.d rather than by editing one shared file, and inspected with apt-cache policy.
-
Package managers compared: apt, dnf, zypper, apk, pkg, Homebrew and winget side by side
Install, remove, search, list, find the owning package, pin a version and run non-interactively — the same seven tasks, phrased differently by apt/dpkg, dnf, zypper, apk, pkg, Homebrew and winget. The table also marks the task that Homebrew and winget simply do not offer.
-
Running apt and dpkg non-interactively on Debian and Ubuntu without hanging on prompts
A scripted apt-get or dpkg run can stall on a debconf prompt, a modified-conffile question or a held dpkg lock. Setting DEBIAN_FRONTEND, the right confold/confdef options and preseeding debconf answers first turns an install into a command that either finishes or fails loudly.
-
DebianとUbuntuでセキュリティ更新を自動適用するためにunattended-upgradesを設定する
unattended-upgradesは、20auto-upgrades(実行の有無と頻度)と50unattended-upgrades(対象の配布元と再起動の有無)の2つのファイルを使い、タイマーでパッケージ更新を適用する。本番環境で有効にする前に--dry-run --debugでテストすると、予期しない再起動や途中までしか適用されない更新を避けられる。
機械可読: JSON