|  | 
 
 发表于 2018-11-30 20:04:44
|
显示全部楼层 
| 本帖最后由 xypmyp 于 2018-11-30 20:19 编辑 
 $ uname -a
 Can you show me what distribution you are using? It seems like it's  Kali linux, Different distribution using different command for install a program.
 
 Base on your distribution, you can easily search from google/baidu:  "Your distribution" firefox/chrome.
 
 For advanced user, you can install program by using Tarball (sources code) (*.tar.gz)
 http://linux.vbird.org/linux_bas ... ball.php#intro_make
 
 CTRL + F "21.4.4 一個簡單的範例、利用 ntp 來示範"
 
 
 
 
 解壓縮下載的 tarball ,並參閱 README/INSTALL 檔案
 
 复制代码[root@study ~]# cd /usr/local/src   <==切換目錄
[root@study src]# tar -zxvf /root/ntp-4.2.8p3.tar.gz  <==解壓縮到此目錄
ntp-4.2.8p3/          <==會建立這個目錄喔!
ntp-4.2.8p3/CommitLog
....(底下省略)....
[root@study src]# cd ntp-4.2.8p3
[root@study ntp-4.2.8p3]# vi INSTALL  <==記得 README 也要看一下!
 # 特別看一下 28 行到 54 行之間的安裝簡介!可以瞭解如何安裝的流程喔!
 
 檢查 configure 支援參數,並實際建置 makefile 規則檔
 
 
 复制代码[root@study ntp*]# ./configure --help | more  <==查詢可用的參數有哪些
  --prefix=PREFIX         install architecture-independent files in PREFIX
  --enable-all-clocks     + include all suitable non-PARSE clocks:
  --enable-parse-clocks   - include all suitable PARSE clocks:
 # 上面列出的是比較重要的,或者是你可能需要的參數功能!
 
 
 复制代码[root@study ntp*]# ./configure --prefix=/usr/local/ntp \
>  --enable-all-clocks --enable-parse-clocks  <==開始建立makefile
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
....(中間省略)....
checking for gcc... gcc           <==也有找到 gcc 編譯器了!
....(中間省略)....
config.status: creating Makefile  <==現在知道這個重要性了吧?
config.status: creating config.h
config.status: creating evconfig-private.h
config.status: executing depfiles commands
config.status: executing libtool commands
 
 一般來說 configure 設定參數較重要的就是那個 --prefix=/path 了,--prefix 後面接的路徑就是『這個軟體未來要安裝到那個目錄去?』如果你沒有指定 --prefix=/path 這個參數,通常預設參數就是 /usr/local 至於其他的參數意義就得要參考 ./configure --help 了! 這個動作完成之後會產生 makefile 或 Makefile 這個檔案。當然啦,這個偵測檢查的過程會顯示在螢幕上, 特別留意關於 gcc 的檢查,還有最重要的是最後需要成功的建立起 Makefile 才行!
 
 最後開始編譯與安裝嚕!
 
 
 复制代码[root@study ntp*]# make clean; make
[root@study ntp*]# make check
[root@study ntp*]# make install
 # 將資料給他安裝在 /usr/local/ntp 底下
 In addition, I think you may need some ways to bypass the wall first I will say.
 
 *My Ibus refuses to type Chinese, sorry about that
  | 
 |