树莓派安装ubuntu22后apt安装软件报错:E: Sub-process /usr/bin/dpkg returned an error code (2)

Preconfiguring packages …
dpkg: warning: ‘ldconfig’ not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root’s PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin

E: Sub-process /usr/bin/dpkg returned an error code (2)

这是因为找不到/sbin,目录下的ldconfig了。

解决:

sudo apt-get download libc-bin
dpkg -x libc-bin*.deb unpackdir/
sudo cp unpackdir/sbin/ldconfig /sbin/
sudo apt-get install --reinstall libc-bin
sudo apt-get -f install 

posted @ 2025-11-08 00:52  郭小睿  阅读(5)  评论(0)    收藏  举报