简体   繁体   中英

Resolving Linux Library Dependencies?

I'm new to Linux, but I'm trying to distribute an application in .deb and .rpm format. I'm having trouble with the below three libicu libraries:

libicui18n.so.52.1 => not found
libicuuc.so.52.1 => not found
libicudata.so.52.1 => not found

The problem is that the version required for the application does not always match the version installed on the system, for example Fedora 26 comes with libicu 57.1 while my application is looking for 52.1. Adding libicu to the package dependency list doest help, because libicu is already installed, so installing libicu just gives:

Package libicu-57.1-6.fc26.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

I couldn't find a package for libicu52.1, but trying to install an older package doesn't seem to work anyway. I tried libicu-54.1-4.fc22.x86_64 but it says no package available, presumably because it's only available on Fedora 22.

I was thinking of including the libraries in the application package and having them install to /usr/lib64, but being a Linux newbie I'm unsure if this is an acceptable thing to do.

What's the best way to solve this?

Edit: I saw this post in the related section which says:

Newer versions of libraries should not break existing apps unless you're using deprecated features.

I'm testing on Fedora 26 which comes with libicu 57.1. My application only requires libicu 52.1, so if the above is true I assume it should be working. Is there something I need to do to make it work?

Having your package install "extra" versions of libicu to /usr/lib64 would be very surprising to most users. Don't do that.

The standard practice here is to build different .deb and .rpm files per target platform. The same as you need to build separately for 32-bit vs 64, you need to build separately for, say, CentOS 6 vs 7. You can do this by running a set of virtual machines to do the release builds--one for each target platform you want to support.

If you truly need to make a single .deb or .rpm that works on many platforms, one way is to eliminate some of your dependencies. In this case, all those libraries are part of the same project (ICU), so if you don't really need to depend on that project, don't.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM