A regular user, joe, has just run:
to build and install a program. However, the installation fails. What could be done to install the program?(Choose TWO correct answers.)
A. Install the binaries manually with suinstall.
B. Run make install with root privileges.
C. Do not run ./configure in order to maintain the default configuration for correct installation.
D. Rerun ./configure with a --prefix option where the user has permissions to write.
E. Run make install_local to install into /usr/local/.
题解
题目中提供的指令,会先利用「configure」这个脚本来创建符合目前操作系统环境的编译环境。如果创建成功的话,接着再透过「make」指令来编译代码。如果编译成功的话,再透过「make install」指令来将编译好的程序安装到操作系统中(预设通常会让程序可执行文件、函数库、标头档、手册等都安装至「/usr/local」目录中)。
选项 A,题目的指令应是正确的,问题不应该是出在指令。
选项 B,正确,因为通常会将编译好的程序安装到「/usr/local」目录中,而若要创建或修改「/usr/local」目录中的文件,预设会需要 root 权限。
选项 C,错误。
选项 D,正确,「configure」这个脚本通常能够借由「--prefix」参数来指定程序的安装目录。
选项 E,通常不会有「make install_local」这样的用法。
