$ sudo apt-get install ntp ntpdate
上面的指令執行安裝完成之後,Ubuntu 就會在每次開機時,自動啟用 ntp 時間伺服器來定期和網路上的時間伺服器做同步和校正,而 Ubuntu 預設使用的 ntp.ubuntu.com,如果想要修改或新增 NTP 伺服器的話,可開啟 /etc/ntp.conf 設定檔,找到下面這一行來變更或新增一筆新的記錄在這一行的下面。
$ server ntp.ubuntu.com
台灣有專門 ntp 伺服器,也有參加 NTP Pool Project,台灣的 NTP 伺服器的清單在這裡,所以,如果要調成使用台灣區的 NTP 伺服器的話,這個 /etc/ntp.conf 的設定檔就要改成下面這個樣子
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server 3.tw.pool.ntp.org
server 1.asia.pool.ntp.or
server 2.asia.pool.ntp.org
# Use Ubuntu's ntp server as a fallback.
server tw.pool.ntp.org變更 /etc/ntp.conf 檔案後,要重啟 NTP 服務來更新清單,所以,請執行下面這一行指令。
$ sudo service ntp restart
另外,關於 ntpdate 這支程式,是可以不安裝的,因為, NTP Client 就會定期更新和校時了,但是,如果你需要手動要求校時或是測試 NTP Server 是不是正常,那就可以安裝 ntpdate 程式,然後,執行下面這一行指令囉 !
$ sudo ntpdate [NTP Server 網址]
例如,
$ sudo ntpdate tw.pool.org.tw
13 Feb 07:51:53 ntpdate[2312]: the NTP socket is in use, exiting
問題還是沒解決嗎 ?? 這裡有更多的 Ubuntu 相關教學可以參考哩 ...
買本阿舍寫的電子書帶走 - Ubuntu 指令新手馬上會用到的 35 個技法
2 則留言 :
sudo atp-get install ntp
=> sudo apt-get install ntp
Hello,
已修正。謝謝囉 !! ^^=
張貼留言