1、
# cd /usr/ports/net/cvsup #进入Ports目录
# make install #进行ports
2、
进入我们要升级的文件支持目录:
# cd /usr/share/examples/cvsup
# ls
README doc-supfile ports-supfile refuse.README standard-supfile
cvs-supfile gnats-supfile refuse stable-supfile www-supfile
cvs-supfile cvsup本身的升级文件
doc-supfile 操作系统文档升级文件
gnats-supfile FreeBSD的bug数据库
ports-supfile ports升级文档
stable-supfile 稳定的操作系统升级
standard-supfile 当前最新版的FreeBSD升级
配置 ports-supfile:
# ee ports-supfile
就会看到类似下面的内容:
# $FreeBSD: src/share/examples/cvsup/ports-supfile,v 1.32 2004/05/24 06:23:15 cjc Exp $
......
默认是更新全部:
## Ports Collection.
#
# The easiest way to get the ports tree is to use the "ports-all"
# mega-collection. It includes all of the individual "ports-*"
# collections,
ports-all
那么如果我不需要更新全部,那么就在 ports-all前面加"#",注释掉它,然后再具体的决定更新那些:
#ports-base
#ports-accessibility
#ports-arabic
#ports-archivers
#ports-astro
#ports-audio
......
CVSup服务器上更新我们的列表,默认是:
*default host=CHANGE_THIS.FreeBSD.org
我们为了更快的速度,一般选择离我们比较近的服务器:
*default host=cvsup.freebsdchina.org
现在我们开始更新,更新输入命令: cvsup -G -L 2 cvsup_file 就可以了,现在我们要更新ports,那么就执行:
# cvsup -G -L 2 ports-supfile
# portsdb -Uu //更新ports资料库更新之后,你使用ports就能获得最新的软件了。
二、ports upgrade
Step1.安裝
#cd /usr/ports/sysutils/portupgrade
#make install clean
Step2.升級注意事項
#pkg_version -v | grep '<' //列出目前的套件及可更新的版本
要用portupgrade時最好先把舊的套件備份起來,以便新的版本有問題時可再解回
#pkg_create -b 要備的套件(ex.openwebmail 2.40) //備份所指定之套件會產生再目前的目錄
#pkg_add -v 要還原的套件(ex.openwebmail 2.40.tgz) //升級後無法使用把升級後的版本移除再利用此行還原原本的套件
Step3.升級套件
#portupgrade 要升級的套件名稱(ex.openwebmail 2.40)
補充
#portsdb -Uu //更新完port tree 後執行此指令來及時更新您的 port INDEX 資料庫(確保 INDEX 跟 ports tree 同步)
#pkgdb -F //修复程序关联性,即更新 /var/db/pkg/pkgdb.db(升級前后都要执行)
#portsclean -CDLP //清除不需要的distfiles、working、旧的 shared libraries
#pkgdb -fu //如果天塌下来就执行,无论如何都不要中断操作
