0

For example, when I write

sudo apt-get install libjpeg-dev

it will install the libjpeg.so library into my system.

Now does the online package repository contain a bunch of different .so files for different systems' architectures and the package manager just downloads the correct one? Or does the package manager compile the library on your system and install the compiled .so file? Or is there some other scenario that I haven't considered?

3 Answers 3

4

In most cases, the package repository contains different packages for different architectures, and the package manager downloads the appropriate package. Some packages are identical on all architectures, and the package manager will download the same package regardless of the local system’s architecture.

Thus on amd64, apt install libjpeg-dev will download a package for the all architecture, which itself depends on a package for the amd64 architecture.

On dpkg/apt based systems, the default architecture is the architecture of the dpkg package. You can configure such systems to use additional architectures, and you then need to specify the appropriate non-default architecture when you want to install the corresponding package (if it’s multiarch-compliant):

sudo apt install libjpeg62-turbo:armhf

Distributions which are source-based rather than binary-based, such as Gentoo, will download the source code and build the library for your system.

0

Modern distros ship with dpkg configured with the correct architecture out of the box.

In case you installed a distro for amd64, you can also add the architecture i386 to install the execution environment of 32 bits in case you have to use the binary distribution of some software not yet provided for the amd64 architecture.

Now does the online package repository contain a bunch of different .so files for different systems architecture and the package manager just downloads the correct one? Or does the package manager compile the library on your system and install the compiled .so file? Or is there some other scenario that I haven't considered?

Depends on the distro. Many popular distros would download the shared object, not build it; e.g. distros using APT or YUM. But again, depends on the distro.

0

RPM based distributions carry packages for different architectures (e.g. x86 and x86_64 for intel 32 and 64 bit), there are also noarch packages that contain no binaries (documentation, scripts, ...). As default, only packages matching the architecture of the machine are installed (and supporting noarch packages), you can ask explicitly for other architectures (for example for cross-compiling). Afterwards installed packages are upgraded normally.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .