【2022年版】 Ubuntu 22.04 で apt install すると、Which services should be restarted?
ときかれる。
はじめに
-
Ubuntu 22.04 環境で、apt install を行うたびに、
Daemons using outdated libraries
Which services should be restarted?
と表示されてしまう。 -
確認なしに必要なデーモンは再起動してくれたら良い。
┌────┤ Daemons using outdated libraries ├─────┐ │ │ │ │ │ Which services should be restarted? │ │ │ │ [ ] networkd-dispatcher.service │ │ [ ] unattended-upgrades.service │ │ │ │ │ │ <Ok> <Cancel> │ │ │ └─────────────────────────────────────────────┘
環境
~$ uname -a
Linux linux 5.15.0-40-generic #43-Ubuntu SMP Wed Jun 15 12:54:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
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=jammy
~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
作業
-
/etc/needrestart/conf.d/
配下に、設定ファイルを作成する。
~$ echo "\$nrconf{restart} = 'a';" | sudo tee /etc/needrestart/conf.d/50local.conf
$nrconf{restart} = 'a';
動作確認
- apt install を行なってみる
参考
おわりに
- かんたんでしたね