当我运行该命令sudo bash
或bash --version
出现以下错误时:
bash: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version 'Qt_5.10' not found (required by bash)
的输出ldd
如下:
$ ldd `which bash`
/usr/bin/bash: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version Qt_5.10' not found (required by /usr/bin/bash)
linux-vdso.so.1 (0x00007ffc3e4e6000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f041be89000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f041bc85000)
libQt5Widgets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f041b43e000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f041acd5000)
libQt5Network.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007f041a949000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f041a1fe000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0419fdf000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0419c51000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f04198b3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f041969b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f04192aa000)
/lib64/ld-linux-x86-64.so.2 (0x00007f041c0a6000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f041901e000)
libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f0418dec000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f0418b4e000)
libicui18n.so.60 => /usr/lib/x86_64-linux-gnu/libicui18n.so.60 (0x00007f04186ad000)
libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007f04182f6000)
libdouble-conversion.so.1 => /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1 (0x00007f04180e5000)
libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f0417dcf000)
libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f0417b9e000)
libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f04178e8000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f0417634000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f0417407000)
libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007f041585e000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f04155ec000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f04152b3000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f041508b000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f0414e87000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f0414c81000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f0414a6c000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0414864000)
的输出which bash
为:
/usr/bin/bash
之前我尝试重新安装 ruby,因为软件包需要 2.2.8 版本,而我的 ruby 2.5.RVM 无法正常工作,所以当我重新安装 ruby 时,这些错误开始出现。
答案1
删除所有 PPA 和/或第三方软件包,然后重试。这不是标准的 Ubuntu 软件包。
常规 bash 命令位于 中/bin/bash
。如果使用完整路径调用它,则应该能够运行它。所讨论的包/usr/bin/bash
是您安装的(可能是错误安装的),并且它优先于命令which
,因为/usr/bin
出现在$PATH
之前/bin
。
您可以通过更改 PATH 变量以使其在/bin
之前列出来规避此问题/usr/bin
。