主题: apt
-
Upgrading Debian and Ubuntu to the next major release without losing a rollback path
Ubuntu's do-release-upgrade and Debian's manual sources-list-then-upgrade procedure both assume a full backup and a console fallback in case the SSH session drops mid-upgrade; Debian's own release notes recommend a minimal upgrade pass before the full one.
-
Adding a third-party APT repository the current way: deb822 .sources files and Signed-By keyrings
apt-key is deprecated; the supported way to add a signed third-party repository is a keyring file under /etc/apt/keyrings referenced by a Signed-By option, written either in classic one-line form or the newer deb822 .sources format that both Debian 12/13 and current Ubuntu releases parse.
-
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.
-
Configuring unattended-upgrades for automatic security patching on Debian and Ubuntu
unattended-upgrades applies package updates on a timer using two files: 20auto-upgrades (whether and how often) and 50unattended-upgrades (which origins and whether to reboot). Testing with --dry-run --debug before enabling it in production avoids surprise reboots or half-applied upgrades.
机器可读: JSON