Which package contains the C standard library?

10,459

Solution 1

This should be available in the glibc package Though most all the packages essential to development and code-building can be found in build-essential

Solution 2

The package name is libc6, if you are trying to build a C app then you will want to install the build-essential package which brings the development packages.

Solution 3

It's libc6 / libc6-dev. For cross compilation for 64 bit / 32 bit systems, you can install libc6-amd64 libc6-dev-amd64 or *i386 repsectively.

The -dev packages are the ones that contain /usr/include/stdlib.h.

Solution 4

In general, you can find which package a file belongs to using the command:

dpkg-query -S /path/to/file

In this case, this does depend on you first knowing which file is the C standard library: /lib/libc6.so.6

Share:
10,459

Related videos on Youtube

Olivier Lalonde
Author by

Olivier Lalonde

Updated on September 17, 2022

Comments

  • Olivier Lalonde
    Olivier Lalonde almost 2 years

    Which package contains the C standard library?

  • Olivia
    Olivia over 13 years
    I'll add that the source package's name in recent Ubuntu versions is eglibc as seen at packages.ubuntu.com/….
  • Olivia
    Olivia over 13 years
    To clarify, although it isn't succinctly apparent from the package description, the host-native packages are libc6 & libc6-dev for either i386 or amd64. For cross-compilation, i386 uses libc6-*amd64, and amd64 uses libc6-*i386.
  • Rob Bazinet
    Rob Bazinet over 13 years
    build-essential is actually a dummy package, which has dependencies on "all you need to make a build". Very usefull, as you seldom know about all the libraries you'll actually need when building your applications from sources. But overkill if you only need the glibc.
  • Rob Bazinet
    Rob Bazinet over 13 years
    Daniel is right: libc6-amd64 (and its 'dev' version) are usefull only for cross-compiling from i386. Whatever your platform, if you want to build for the same platform, you only need libc6/libc6-dev.
  • flo
    flo over 13 years
    Edited the answer accordingly. That's quite important sorry I missed it. :-)