make install 出错:“无法复制文件”

Lím*_*llo 5 make

我正在尝试安装 CLHEP 2.3.4.4,但我被卡住了,出现错误make install

[ 99%] Built target exctest3 
[ 99%] Built target exctestNothrow
[100%] Built target testzmex
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/bin/clhep-config
CMake Error at cmake_install.cmake:36 (file):
  file INSTALL cannot copy file
  "/home/ivan/CLHEP/2.3.4.4/CLHEP/2.3.4.4-build/clhep-config" to
  "/usr/local/bin/clhep-config".
Makefile:105: recipe for target 'install' failed
make: *** [install] Error 1
Run Code Online (Sandbox Code Playgroud)

我能做些什么来解决这个问题?

Byt*_*der 8

试试sudo make install

要访问/usr安装目录以在那里存储系统范围的文件,安装程序需要 root 权限。因此,您不能仅以make install普通用户帐户的身份运行,而是需要sudo用于提升权限。