FreeBSD CVSup 安裝與應用

我這裡就不詳加介紹如何安裝 FreeBSD 了
網路上的相關文件已經夠多了
或者你可以參考 OHaHa’s 學習心得 的教學

CVSup 是在 FreeBSD 系統中相當重要的程式
功用在於更新最新的 port tree 以及 source
可以讓你使用 ports 安裝程式時 能夠裝上最新的程式
也可以借此更新 source 來升級系統

CVSup 的安裝其實非常簡單
只要在安裝 FreeBSD 時 有選擇安裝 ports 且已經正確連上網路
便可輕鬆由下列方式安裝:
# cd /usr/ports/net/cvsup-without-gui
# make install clean

安裝的時間可能會很長 不過請耐心等候 因為 這是值得的

附註: FreeBSD 預設安裝時是從國外網站抓取套件
你可以借由下列步驟使其從國內網站抓取 加快速度
將前面 # 註解拿掉 位址則輸入你想要的 FTP 站台
複製 make.conf 至 /etc/ 底下
# cp /etc/defaults/make.conf /etc/
# ee /etc/make.conf

編輯 make.conf 修改下列地方
MASTER_SITE_BACKUP?= ftp://ftp.tw.freebsd.org/pub/ports/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}

再來就可以使用 CVSup 來更新我們的 port tree 和 source 了
我習慣是將 ports-supfile 從 /usr/share/examples/cvsup/ 複製到 /root/ 後才編輯

# cp /usr/share/examples/cvsup/ports-supfile /root/
# ee /root/ports-supfile

編輯ports-supfile 更改下列部分
你可以將它改為 cvsup.tw.freebsd.org
完全看你希望藉由哪台 FTP 站進行更新
*default host=CHANGE_THIS.FreeBSD.org

好啦… 現在我們可以進行第一次的 port tree 更新囉!!
如果你安裝完CVSup尚未重新開機 請先執行 rehash
# rehash
# cvsup -g -L 2 /root/ports-supfile

第一次更新可能會花一段時間 而以後則不會這麼久了 除非 port tree 有做大動作的更動

另外 port tree 的更新也可以設定是要全部更新 還是局部更新
一樣是藉由編輯 ports-supfile 來設定:
全部更新:
保持未註解狀態 將其他加上 # 予以註解
ports-all

部分更新:
前面加上 # 註解掉 將欲更新的 ports 前面 # 拿掉解除註解
# ports-all

Trackback URL for this post:

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.
Web Hosting by Arvixe