Ubuntu 24.04 安装使用约半年后需要基于 Yocto OSTLv6.1.0 重新生成镜像以复现客户问题。但原先可以正常编译成功的镜像现在持续编译失败。失败log如下NOTE:Executing Tasks ERROR:update-rc.d-0.8git-r0 do_package:Error executing a python function inexec_func_python()autogenerated:The stack trace of python calls that resulted in this exception/failure was:File:exec_func_python() autogenerated,lineno:2,function:module0001:***0002:perform_packagecopy(d)0003:File:layers/openembedded-core/meta/classes-global/package.bbclass,lineno:363,function:perform_packagecopy0359:rpath_replace(dvar,d)0360:}0361:perform_packagecopy[cleandirs]${PKGD}0362:perform_packagecopy[dirs]${PKGD}***0363:0364:pythonpopulate_packages(){0365:oe.package.populate_packages(d)0366:}0367:populate_packages[dirs]${D}File:/usr/lib/python3.12/subprocess.py,lineno:466,function:check_output0462:else:0463:emptyb0464:kwargs[input]empty0465:***0466:returnrun(*popenargs,stdoutPIPE,timeouttimeout,checkTrue,0467:**kwargs).stdout0468:0469:0470:classCompletedProcess(object):File:/usr/lib/python3.12/subprocess.py,lineno:571,function:run0567:# We dont call process.wait()as.__exit__ does thatforus.0568:raise0569:retcodeprocess.poll()0570:ifcheck and retcode:***0571:raiseCalledProcessError(retcode,process.args,0572:outputstdout,stderrstderr)0573:returnCompletedProcess(process.args,retcode,stdout,stderr)0574:0575:Exception:subprocess.CalledProcessError:Command tar--exclude./sysroot-only-cf--C tmp-glibc/work/all-oe-linux/update-rc.d/0.8git/image-p-S.|tar-xf--C tmp-glibc/work/all-oe-linux/update-rc.d/0.8git/package returned non-zero exit status2.Subprocess output:got*at()syscallforunknown directory,fd4unknown base pathforfd4,path sbin couldnt allocate absolute path for sbin.tar:./usr/sbin:Cannot mkdir:Bad address got*at()syscallforunknown directory,fd4unknown base pathforfd4,path sbin couldnt allocate absolute path for sbin.got*at()syscallforunknown directory,fd4unknown base pathforfd4,path sbin couldnt allocate absolute path for sbin.tar:./usr/sbin:Cannot mkdir:Bad address tar:./usr/sbin/update-rc.d:Cannot open:No such file or directory tar:Exiting with failure status due to previous errors将失败日志交给 AI 工具分析后初步判断为 pseudo 路径解析异常 导致的问题。不过手动执行日志中的 tar 打包复制命令时并不会直接报错。将 Yocto 从 OSTLv6.1.0 升级到 OSTLv6.2.1 后重新编译没有报错。查看 openembedded-core 的 git log, 发现有一个修复提交跟问题相关https://git.openembedded.org/openembedded-core/commit/meta/recipes-devtools/pseudo?hscarthgapid34b74540ee497e2cc89211d7aa2772097b6fa79b于是将 OSTLv6.2.1openembedded-core 版本 yocto-5.0.17的文件夹layers/openembedded-core/meta/recipes-devtools/pseudo覆盖到OSTLv6.1.0 openembedded-core 版本 yocto-5.0.8layers/openembedded-core/meta/recipes-devtools/pseudo后重新编译问题解决。但为什么以前可以正常编译的镜像现在突然会编译失败呢我猜想肯定跟系统环境配置相关但去排除是Ubuntu的哪个配置导致的这个问题犹如大海捞针没有什么头绪。那就用AI工具试一下用命令zcat-f/var/log/apt/history.log*atp_install_package.txt将 Ubuntu 24.04 安装后所有安装包的数据都统计出来喂给AI并分析可能是哪个安装包导致Yocto编译失败。AI解析后给了方向3次 tar 包的版本升级。2026-06-27: tar 1.35dfsg-3build1 - 1.35dfsg-3ubuntu0.1 2026-07-07: tar 1.35dfsg-3ubuntu0.1 - 1.35dfsg-3ubuntu0.2 2026-07-17: tar 1.35dfsg-3ubuntu0.2 - 1.35dfsg-3ubuntu0.3为了验证是否是 tar 升级导致的问题将系统中的 tar 回退到最初版本sudoaptinstall--allow-downgradestar1.35dfsg-3build1然后使用编译会失败的Yocto OSTLv6.1.0 重新编译镜像。编译成功