dpkg –configure -a命令报错’ldconfig’、’start-stop-daemon’和expected programs not found

  • A+
所属分类:Linux

'ldconfig' not found,'start-stop-daemon' not found,--preserve-environment,dpkg: error,dpkg: warning:,expected programs not found,dpkg --configure -a命令报错'ldconfig'、'start-stop-daemon'和expected programs  not found

1
2
3
4
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin

原因:使用非root用户su后进行安装,所以导致参数和环境无法传递的问题
解决方法:给sudo命令加入参数,使用-p

1
sudo -p xxx你要执行的命令

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: