Cannot locate file from parent directory(s)

Segolia

Apologies if this isn't the appropriate place for this question

I'm running an Amazon Lightsail VPS with an Ubuntu 14.04 image and trying to install various packages through npm. One particular package installation fails because it can't locate a file at

/usr/lib/x86_64-linux-gnu/pkgconfig/cairo.pc

When I check the directory, the file definitely exists and has the expected contents and appropriate permissions

user@hostname:/usr/lib/x86_64-linux-gnu$ stat -c "%a %n" ./pkgconfig/cairo.pc
  644 ./pkgconfig/cairo.pc

user@hostname:/usr/lib/x86_64-linux-gnu$ locate cairo.pc
  /usr/lib/x86_64-linux-gnu/pkgconfig/cairo.pc
  /usr/lib/x86_64-linux-gnu/pkgconfig/pangocairo.pc

user@hostname:/usr/lib/x86_64-linux-gnu$ cat ./pkgconfig/cairo.pc
  prefix=/usr
  exec_prefix=${prefix}
  libdir=${prefix}/lib/x86_64-linux-gnu
  ...
  //etc. - excluded for brevity

But interestingly, when I try to locate the file via find it states that the file cannot be found from outside of its directory, even though it's listed in the output (shortened for brevity)

user@hostname:/usr/lib/x86_64-linux-gnu/pkgconfig$ find cairo.pc
  cairo.pc

user@hostname:/usr/lib/x86_64-linux-gnu/pkgconfig$ cd ..

user@hostname:/usr/lib/x86_64-linux-gnu$ find ./pkgconfig cairo.pc
  ./pkgconfig
  ./pkgconfig/gio-2.0.pc

  ...
  ./pkgconfig/gmodule-2.0.pc
  ./pkgconfig/cairo-ft.pc
  ./pkgconfig/cairo.pc
  ./pkgconfig/xau.pc
  ./pkgconfig/cairo-svg.pc
  ./pkgconfig/gmodule-export-2.0.pc
  ...

  find: `cairo.pc': No such file or directory

This lead me to believe that there's some quirk with the file in the filesystem or permissions that are preventing it from being found (like a bad cache or something), as opposed to an error with the package/package manager, but I honestly have no idea where to begin as a linux newbie

Any ideas would be greatly appreciated

George Udosen

Your running that command the wrong way, this:

find ./pkgconfig cairo.pc

should have been:

find ./pkgconfig -name cairo.pc

In your case your asking find to search in two paths ./pkgconfig and cairo.pc(which is a file not a directory). If you had done:

find ./pkgconfig ./another_folder -name cairo.pc

It would find cairo.pc in those two locations, but in your case your searching in just pkgconfig folder so find ./pkgconfig -name cairo.pc is the right command to use.

Please see man find for how to use the find command and here for more explanations.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related