描述#
如題,在 Debian11 中執行 apt update 過程中,出現 Debian bookworm 報錯
報錯內容如下
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
N: Repository 'Debian bookworm' changed its 'non-free component' value from 'non-free' to 'non-free non-free-firmware'
N: More information about this can be found online in the Release notes at: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split
究其原因是版本更迭導致 apt 源的 non-free 組件出現了變更,按理如告警描述修改 sources.list 的文件內容,將 non-free 改為 non-free-firmware 即可。
當然,如果已經修改國內源,還需去公開的源列表查看一下組件是否正確。一般情況下按開源的 apt 源描述修改 sources.list 不會產生這個問題(這不是廢話嗎)
凡事都有例外,不然也不會記錄下來。
我使用的機器處在一個內網環境,內網部署了源鏡像,通過代理轉發的方式去握手源組件地址。這種情況下修改文件可能依舊可能產生問題。
例如:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Skipping acquire of configured file 'non-free-firmware/source/Sources' as repository 'http://repos.inside.com:19796/debian bullseye-updates InRelease' doesn't have the component 'non-free-firmware' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free-firmware/binary-amd64/Packages' as repository 'http://repos.inside.com:19796/debian bullseye-updates InRelease' doesn't have the component 'non-free-firmware' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free-firmware/i18n/Translation-en' as repository 'http://repos.inside.com:19796/debian bullseye-updates InRelease' doesn't have the component 'non-free-firmware' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free-firmware/i18n/Translation-zh_CN' as repository 'http://repos.inside.com:19796/debian bullseye-updates InRelease' doesn't have the component 'non-free-firmware' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free-firmware/i18n/Translation-zh' as repository 'http://repos.inside.com:19796/debian bullseye-updates InRelease' doesn't have the component 'non-free-firmware' (component misspelt in sources.list?)
出於安全考慮,地址我胡說的,但實際就是通過這種方式定位到遠端的源組件,以實現內網設備可以進行 apt 更新和安裝。
這種情況下 apt 給出的信息是該地址沒有 non-free-firmware 組件。那就意味著我無法通過修改 non-free 為 non-free-firmware 這種方式實現 apt 更新。
這也是上面描述的要去源地址頁面查看 debian 源的組件的原因。
廢話說的有點多了。下面是解決辦法
解決辦法#
經典的找不到解決辦法就解決提出問題的 “人”,不讓 apt 告警即可
su -c 'echo "APT::Get::Update::SourceListWarnings::NonFreeFirmware \"false\";" > /etc/apt/apt.conf.d/no-bookworm-firmware.conf'
執行上述命令後,可以進行 apt 更新以及安裝其他包