xChar
·a year ago

描述

如题,在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更新以及安装其他包

参考

Loading comments...