Search code examples
linuxubuntuubuntu-16.04ln

linux: can't create a link


I faced to next trouble when I try create a link

sudo ln /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib64/libpthread_nonshared.a

I get: '/usr/lib/x86_64-linux-gnu/libpthread_nonshared.a' not such file or directory. Despite locate return exactly same result:

locate libpthread_nonshared.a
/usr/lib/x86_64-linux-gnu/libpthread_nonshared.a

Solution

  • The destination likely doesn't exist. Either create /usr/lib64 then link. Another option is to just symbolically link the entire directory.

    sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
    

    Ubuntu uses the path x86_64-linux-gnu, while many other distros use the lib64 path. I'm guessing you are installing/using something that is only looking for /usr/lib64/*