テーマ: debian
-
ロールバックの手段を保ちながら Debian と Ubuntu を次のメジャーリリースへアップグレードする
Ubuntu の do-release-upgrade と、ソースリストを手動で変更してからアップグレードする Debian の手順は、どちらも完全なバックアップと、アップグレード中に SSH セッションが切れた場合に備えたコンソールへの代替アクセスを前提とする。Debian 自身のリリースノートは、完全なアップグレードの前に最小限のアップグレードを行うことを推奨している。
-
Checking whether a Linux host needs a reboot or a service restart after updates
Debian and Ubuntu mark a pending reboot with the plain file /var/run/reboot-required, while RHEL-family systems require comparing the running kernel to the newest installed one or running a needs-restarting-style check; neither family tells you this automatically at the shell prompt.
-
Configuring network interfaces with netplan on Ubuntu, and testing changes without losing the connection
Netplan renders YAML under /etc/netplan into networkd or NetworkManager configuration; `netplan try` applies a change and automatically reverts it if nobody confirms within a timeout, which is the safe way to change network settings on a remote host. Debian's ifupdown /etc/network/interfaces is the older, still-supported contrast.
-
Setting locale, timezone and reconfiguring packages non-interactively on Debian and Ubuntu
localectl, timedatectl and update-locale change locale and timezone without a text-mode dialog, and dpkg-reconfigure -f noninteractive re-runs a package's debconf-driven setup the same way a script would run the original install, both usable in provisioning scripts with no terminal attached.
-
現在の方法でサードパーティーAPTリポジトリを追加する:deb822 .sourcesファイルとSigned-Byキーリング
apt-keyは非推奨である。署名付きサードパーティーリポジトリを追加する対応済みの方法は、/etc/apt/keyrings内のキーリングファイルをSigned-Byオプションで参照することだ。従来の1行形式、またはDebian 12/13と現在のUbuntuリリースが解釈できる新しいdeb822 .sources形式で記述する。
-
debsumsとdpkg --verifyでDebian・Ubuntuのインストール済みパッケージの整合性を確認する
debsumsはインストール済みファイルをパッケージのビルド時に記録されたMD5値と比較し、dpkg --verify(dpkg 1.17.2以降)はdpkgデータベース自体に記録されたメタデータと比較します。dpkg -S/-Lでは、再インストールを判断する前に「このファイルはどのパッケージのものか」「このパッケージは何をインストールしたか」を確認できます。
-
Adding a private CA to the system trust store on RHEL-family and Debian/Ubuntu
RHEL-family and Debian-family Linux keep separate mechanisms for adding a locally trusted CA certificate: update-ca-trust with anchors under /etc/pki/ca-trust, and update-ca-certificates with .crt files under /usr/local/share/ca-certificates. Using the wrong directory or extension silently leaves the CA untrusted.
-
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.
-
Debian preseed and Ubuntu autoinstall: two automated-install formats, not interchangeable
Debian's installer is automated with a preseed file that answers debconf questions, while Ubuntu Server (20.04+) and Desktop (23.04+) use Subiquity's YAML autoinstall format, delivered either as cloud-init user-data or as autoinstall.yaml on the install media. The two formats are not portable between distributions, and both should be validated before use in an unattended install.
-
Managing installed kernels on Debian and Ubuntu: cleanup, /boot space, HWE and Livepatch
Old kernel packages accumulate in /boot until apt autoremove clears them; Ubuntu additionally offers a rolling Hardware Enablement (HWE) kernel on LTS releases and Canonical's Livepatch service for applying kernel security fixes without an immediate reboot — both Ubuntu-specific, with no Debian equivalent.
-
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.
-
Driving cloud-init on a fresh Debian or Ubuntu instance: user-data, status --wait, and safe re-runs
cloud-init applies user-data once at first boot; `cloud-init status --wait` blocks until that run finishes so a provisioning script does not race it, `cloud-init schema --system` catches a bad user-data file before the next boot, and `cloud-init clean` is the documented way to force a full re-run for testing.
-
DebianとUbuntuでセキュリティ更新を自動適用するためにunattended-upgradesを設定する
unattended-upgradesは、20auto-upgrades(実行の有無と頻度)と50unattended-upgrades(対象の配布元と再起動の有無)の2つのファイルを使い、タイマーでパッケージ更新を適用する。本番環境で有効にする前に--dry-run --debugでテストすると、予期しない再起動や途中までしか適用されない更新を避けられる。
-
Working with AppArmor profiles on Debian and Ubuntu: status, complain mode and local overrides
AppArmor confines individual programs by profile rather than by user; aa-status shows what is loaded and enforced, aa-complain/aa-enforce switch a profile between logging-only and blocking, and /etc/apparmor.d/local holds site-specific additions that survive package upgrades of the shipped profile.
機械可読: JSON