0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Ubuntu】apt upgradeしたがdeferred due to phasingでパッケージの更新に失敗する

0
Last updated at Posted at 2026-04-08

事象

ますはパッケージ一覧の更新を行う(sudo apt update)。
11個のパッケージが更新可能らしい(11 packages can be upgraded.)。

~$ sudo apt update
[sudo] password for *****:
Get:1 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Hit:2 http://archive.ubuntu.com/ubuntu noble InRelease
Get:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:4 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1578 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1876 kB]
Get:7 http://security.ubuntu.com/ubuntu noble-security/main Translation-en [252 kB]
Get:8 http://security.ubuntu.com/ubuntu noble-security/main amd64 Components [21.5 kB]
Get:9 http://security.ubuntu.com/ubuntu noble-security/main amd64 c-n-f Metadata [10.7 kB]
Get:10 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [2763 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble-updates/main Translation-en [342 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Components [177 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [2900 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble-updates/restricted Translation-en [673 kB]
Get:15 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Components [212 B]
Get:16 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [1663 kB]
Get:17 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Components [386 kB]
Get:18 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Components [940 B]
Get:19 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Components [7364 B]
Get:20 http://archive.ubuntu.com/ubuntu noble-backports/restricted amd64 Components [216 B]
Get:21 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Components [13.2 kB]
Get:22 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Components [212 B]
Get:23 http://security.ubuntu.com/ubuntu noble-security/restricted Translation-en [644 kB]
Get:24 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Components [212 B]
Get:25 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Components [74.2 kB]
Get:26 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Components [212 B]
Fetched 13.8 MB in 7s (1997 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
11 packages can be upgraded. Run 'apt list --upgradable' to see them.

念のため更新されるパッケージを確認する(apt list --upgradable)。

~$ apt list --upgradable
Listing... Done
libnss-systemd/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
libpam-systemd/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
libsystemd-shared/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
libsystemd0/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
libudev1/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
systemd-dev/noble-updates 255.4-1ubuntu8.15 all [upgradable from: 255.4-1ubuntu8.14]
systemd-resolved/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
systemd-sysv/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
systemd-timesyncd/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
systemd/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]
udev/noble-updates 255.4-1ubuntu8.15 amd64 [upgradable from: 255.4-1ubuntu8.14]

パッケージの更新を試みたところ(sudo apt upgrade)、更新に失敗したように見える(11 not upgraded)。

どうやら、段階的更新による延期が原因らしい(deferred due to phasing)。

~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following upgrades have been deferred due to phasing:
  libnss-systemd libpam-systemd libsystemd-shared libsystemd0 libudev1 systemd systemd-dev systemd-resolved
  systemd-sysv systemd-timesyncd udev
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

実行環境

Windows11上のWSL2(Ubuntu 24.04 LTS)で実施した。

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.4 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

原因

段階的更新(Phased updates)について、以下に説明があった。

段階的更新(Phased updates)とは、すべてのユーザに同時に更新するのではなく、段階的にユーザに更新を配布するソフトウェア更新のことである、とのこと。

Phased updates are software updates that are gradually rolled out to users rather than all users getting the updates at the same time.

aptで段階的更新(Phased updates)が行われるようになったのは21.04から、とのこと。

phased updates in apt have been a thing since Ubuntu 21.04

段階的更新(Phased updates)を行う理由は、もし更新内容に問題があった場合、先行して配布していたユーザからの報告で問題を検知することが可能であり、全体への更新を止めることができるから、とのこと。

Phased updates make it so that, in the event an update is bad, it gets caught early before everyone gets the update. Once an update is pushed out, some users get it sooner than others. And if those users' systems start reporting back crashes (or if severe problems with a package come to light), the phasing process can be stopped, making it so that the update stops being sent to users by default.

従って、更新に失敗した原因は、段階的更新(Phased updates)のなかで先行して配布されるユーザに自分は選ばれなかったから、ということになる。

所感

段階的更新(Phased updates)のなかで先行して更新が配信されるユーザは比較的バグを踏む可能性が高いということになる。
業務用の場合、先行して配信されるユーザに選ばれるのは避けたいが、避ける方法が調べても分からなかった。

以下は強制的に更新の先行配信を行う方法らしい。

If you are absolutely sure that you want to bypass update phasing, you can change apt's configuration by creating a file in /etc/apt/apt.conf.d, containing the following lines:
Update-Manager::Always-Include-Phased-Updates; APT::Get::Always-Include-Phased-Updates;
You can name the file 99-Phased-Updates if /etc/apt/apt.conf.d/99-Phased-Updates doesn't already exist.

私の環境だと99-Phased-Updatesというファイルは無かったので、ファイルを作ってsudo apt upgradeすれば、今回更新に失敗した11個のパッケージの更新が行われると思われるが、面倒なので試していない。

~$ ls -l /etc/apt/apt.conf.d/
total 48
-rw-r--r-- 1 root root   92 Apr  8  2022 01-vendor-ubuntu
-rw-r--r-- 1 root root  399 Apr  1  2024 01autoremove
-r--r--r-- 1 root root  496 Nov 24  2024 02autoremove-postgresql
-rw-r--r-- 1 root root  392 Oct 27 21:42 20apt-esm-hook.conf
-rw-r--r-- 1 root root   80 Feb 19  2021 20auto-upgrades
-rw-r--r-- 1 root root 1037 Nov  9  2023 20packagekit
-rw-r--r-- 1 root root  127 Dec  1  2022 20snapd.conf
-rw-r--r-- 1 root root 2569 Feb 25  2024 50appstream
-rw-r--r-- 1 root root  625 Dec  8  2021 50command-not-found
-rw-r--r-- 1 root root 6155 Jan 15  2022 50unattended-upgrades
-rw-r--r-- 1 root root  182 Feb 20  2022 70debconf

強制的に更新の先行配信を行う方法よりも、先行配信に含めない方法のほうが需要はあるのではないかと思うが、平等にランダムで先行配信を行うという方針なのだと思われる。

ちなみに、apt full-upgradeを行っても、同様に段階的更新による延期のため(deferred due to phasing)更新できなかった(11 not upgraded)。

~$ sudo apt full-upgrade
[sudo] password for *****:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following upgrades have been deferred due to phasing:
  libnss-systemd libpam-systemd libsystemd-shared libsystemd0 libudev1 systemd systemd-dev systemd-resolved
  systemd-sysv systemd-timesyncd udev
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?