dpkg-buildpackage -uc -us -b fails with “dpkg-shlibdeps: error: couldn't find library libmono-2.0.so.1 needed by …monodis.”

a 夏天 提交于 2019-12-11 03:09:06

问题


Trying to build simple .deb packages with this script is failing with this:

   dh_installexamples
   dh_installman
   dh_installcatalogs
   dh_installcron
   dh_installdebconf
   dh_installemacsen
   dh_installifupdown
   dh_installinfo
   dh_pysupport
   dh_installinit
   dh_installmenu
   dh_installmime
   dh_installmodules
   dh_installlogcheck
   dh_installlogrotate
   dh_installpam
   dh_installppp
   dh_installudev
   dh_installwm
   dh_installxfonts
   dh_bugfiles
   dh_lintian
   dh_gconf
   dh_icons
   dh_perl
   # Skipping dh_usrlocal - empty override
   dh_link
   dh_compress
   dh_fixperms
   dh_strip
   dh_makeshlibs
   dh_shlibdeps
dpkg-shlibdeps: error: couldn't find library libmono-2.0.so.1 needed by debian/7digital-mono/usr/usr/bin/monodis (ELF format: 'elf64-x86-64'; RPATH: '').
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/7digital-mono.substvars debian/7digital-mono/usr/usr/bin/mono debian/7digital-mono/usr/usr/bin/mprof-report debian/7digital-mono/usr/usr/bin/mono-sgen debian/7digital-mono/usr/usr/bin/pedump debian/7digital-mono/usr/usr/bin/monograph debian/7digital-mono/usr/usr/bin/monodis debian/7digital-mono/usr/usr/lib/mono/4.5/mcs.exe.so debian/7digital-mono/usr/usr/lib/mono/4.5/mscorlib.dll.so debian/7digital-mono/usr/usr/lib/mono/2.0/mscorlib.dll.so debian/7digital-mono/usr/usr/lib/libMonoSupportW.so debian/7digital-mono/usr/usr/lib/libikvm-native.so debian/7digital-mono/usr/usr/lib/libmono-2.0.so.1.0.0 debian/7digital-mono/usr/usr/lib/libMonoPosixHelper.so debian/7digital-mono/usr/usr/lib/libmono-profiler-log.so.0.0.0 debian/7digital-mono/usr/usr/lib/libmono-profiler-cov.so.0.0.0 debian/7digital-mono/usr/usr/lib/libmono-profiler-aot.so.0.0.0 debian/7digital-mono/usr/usr/lib/libmonosgen-2.0.so.0.0.0 debian/7digital-mono/usr/usr/lib/libmono-profiler-iomap.so.0.0.0 returned exit code 2
make: *** [binary] Error 9
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

Any idea what this means?


回答1:


it means that the binary found (during the build-process) as debian/7digital-mono/usr/usr/bin/monodis (and which will likely end up as /usr/bin/monodis) is linking against libmono-2.0.so.1 but this file cannot be found.

i suspect that the .so-file is part of your package as well (though you haven't given any clue about this), so it's not yet installed on the target system.

what i find most strange is the double occurence of usr in your path, which might well indicate where the problem lies: dpkg-shlibdeps (by means of the linker) probably looks for the .so-file in the standard paths (e.g. usr/lib) and in the package paths (e.g. debian/7digital-mono/usr/lib), but it will not look into debian/7digital-mono/usr/usr/lib




回答2:


Change "debian/rules" file accordingly to indicate the right path to LD_LIBRARY

Search for "dh binary-arch" in rules file and replace with

LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/lib/i386-linux-gnu:/lib/i386-linux-gnu dh binary-arch

OR

LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/path-1-to-shared-library:/path-2-to-shared-library dh binary-arch

OR

LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/path-to-shared-library dh binary-arch


来源:https://stackoverflow.com/questions/15187344/dpkg-buildpackage-uc-us-b-fails-with-dpkg-shlibdeps-error-couldnt-find-li

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!