6

I'm trying to build btrfs-progs from sources, but when I run ./configure I get the error:

checking for BLKID... no
configure: error: Package requirements (blkid) were not met:

No package 'blkid' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables BLKID_CFLAGS
and BLKID_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

blkid is installed in /sbin so, presumably, all its libraries are in the default locations.

What do I need to do tell pkg-config where blkid is or am I actually missing a package?

FYI: I'm running Debian 8 (sid/unstable) with a 4.1.0 kernel built from github.com/torvalds/linux.git sources about a week ago (commit:g6aaf0da).

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
StarNamer
  • 3,112
  • 1
  • 22
  • 33

4 Answers4

8

If there are missing packages, you can use apt-cache:

% apt-cache search blkid
libblkid-dev - block device id library - headers and static libraries
libblkid1 - block device id library

or even:

% apt-cache search blkid | grep '\-dev'
libblkid-dev - block device id library - headers and static libraries

We know that we need the development libraries to compile something, therefore do a...

apt-get install libblkid-dev

...as root user.

Fabby
  • 5,836
  • 2
  • 22
  • 38
A.B.
  • 3,372
  • 2
  • 17
  • 27
2

When you're building a binary from source that links to a particular library, the build process requires a few extra ("header") files related to that library that aren't needed during runtime, so they are not installed along with the base library package (since other distro packages which need the library itself are already built binaries).

On Debian, the extra files are in -dev packages. The actual library here is libblkid, so you need:

apt-get install libblkid-dev
goldilocks
  • 86,451
  • 30
  • 200
  • 258
1

Run

apt-get build-dep btrfs-tools

to get all the build-dependencies including libblkid-dev.

Jodka Lemon
  • 3,143
  • 13
  • 42
  • That will install the build dependencies for the `btrfs-tools` version in your package repository, rather than for the newer version you're trying to build. It will still work most of the time, but might not suffice when the newer version of `btrfs-tools` has added new dependencies (like back in the day when mainline btrfs already supported some newer compression algorithm, but Debian's version didn't know about it yet). – n.st Jul 12 '15 at 14:04
  • Yes, thats true, but normally `.configure` will test for this. – Jodka Lemon Jul 12 '15 at 14:39
0

Solution for arch-distros:

sudo pacman -S util-linux libutil-linux
dude
  • 19
  • 4