1. 問題現(xiàn)象
??安裝ubuntu 22.04.2
版本后,安裝軟件時(shí),總是提示:Running kernel seems to be up-to-date. Restarting services... Daemons using outdated libraries
root@ubuntu-pattern:/home/david# apt install -y net-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
net-tools
0 upgraded, 1 newly installed, 0 to remove and 92 not upgraded.
Need to get 204 kB of archives.
After this operation, 819 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu jammy/main amd64 net-tools amd64 1.60+git20181103.0eebece-1ubuntu5 [204 kB]
Fetched 204 kB in 2s (107 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package net-tools.
(Reading database ... 66539 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20181103.0eebece-1ubuntu5_amd64.deb ...
Unpacking net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
Setting up net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
Scanning processes...
Scanning candidates...
Scanning linux images...
Running kernel seems to be up-to-date.
Restarting services...
Daemons using outdated libraries
--------------------------------
1. networkd-dispatcher.service 2. unattended-upgrades.service
(Enter the items or ranges you want to select, separated by spaces.)
Which services should be restarted?
2. 問題分析
??根據(jù)因?yàn)樘崾荆笾乱馑际钦f本地安裝的networkd-dispatcher.service, unattended-upgrades.service
這兩個(gè)服務(wù)版本太舊,問我們是否需要更新這兩個(gè)服務(wù)。(其實(shí)潛臺(tái)詞就是我們再安裝程序的時(shí)候,ubuntu
自動(dòng)下載了這連個(gè)服務(wù)的新版本)
??這種設(shè)計(jì)確實(shí)還是有點(diǎn)煩人的,特別是再執(zhí)行腳本的時(shí)候,如果還有這種交互流程,那就非常不方便了。
??網(wǎng)上搜索了一下,主要看來有三種解決方案:1、自動(dòng)重啟服務(wù) 2、列出需要重啟的服務(wù),用戶自行決定是否需要重新服務(wù) 3、刪除每次通過apt/apt-get
安裝軟件時(shí)自動(dòng)更新程序
3. 解決方案
??這三種解決方案,選擇其中的一種即可,不需要都設(shè)置。
3.1. 每次自動(dòng)重啟更新的服務(wù)
sudo sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf
3.2. 列出自動(dòng)更新的服務(wù),由用戶自行決定是否需要重啟服務(wù)
sudo sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'l'"'"';/g' /etc/needrestart/needrestart.conf
3.3. 移除自動(dòng)更新服務(wù)的程序
sudo apt-get remove needrestart
4. 參考文獻(xiàn)
1、apt-get upgrade auto restart services文章來源:http://www.zghlxwxcb.cn/news/detail-734625.html
2、How to stop ubuntu pop-up “Daemons using outdated libraries” when using apt to install or update packages? 文章來源地址http://www.zghlxwxcb.cn/news/detail-734625.html
到了這里,關(guān)于[Ubuntu 22.04.2] Running kernel seems to be up-to-date. Restarting services Daemons using outdated的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!