A regular user, joe, has just run:



./configure && make && make install

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」這樣的用法。