I am a beginner to Linux. I tried to install a program via console. It may take much time if I ask to software owners and I think problem is with my Linux knowledge. The steps were

mkdir build
cd build
cmake ..

Until this point everything seems to be OK. But when I type make install subsequently, it gives error as,

[100%] Built target gmsh
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/bin/gmsh
Cmake Error at cmake_install.cmake:36 (FILE):
    file INSTALL cannot copy file " /home/orxan/build/gmsh" to "/usr/local/bin/gmsh".

make: *** [install] Error 1

migrated from stackoverflow.com Mar 2 '12 at 16:15

This question came from our site for professional and enthusiast programmers.

  • 1
    try sudo make – perreal Mar 2 '12 at 15:33
  • 4
    Do you have permission to write to /usr/local/ ? sudo make install will probably do the trick. – wildplasser Mar 2 '12 at 15:33
  • 1
    Off-topic here. I suggest asking on unix. – Oded Mar 2 '12 at 15:34
  • @perreal,wildplasser: that solved problem. Thank you. – Shibli Mar 2 '12 at 15:37
cannot copy file " /home/orxan/build/gmsh" to "/usr/local/bin/gmsh"

In this case, you will need sudo privileges to write to /usr/local/bin, as it's owned by root.

sudo make install

Actually, this is the case for most software installations. make itself doesn't require these privileges, but installing almost exclusively does. You can theoretically chown the /usr/local/bin directory to be owned by you, but this could cause unforeseen problems.

  • Often, you can make install DESTDIR=/tmp/softinst/ without being root, then copy recursively it, e.g. sudo cp -v -R -p /tmp/softinst/. /. – Basile Starynkevitch Mar 2 '12 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.