#cd /usr/ports/net/cvsup-without-gui/ #make install clean //安裝 #cd /usr/share/examples/cvsup/ //存放更新範例路徑 文件範例說明: cvs-supfile //更新Main source tree and ports collection doc-supfile //更新Document gnats-supfile //更新FreeBSD bug database ports-supfile //更新Ports collection stable-supfile //更新Main source tree standard-supfile //更新Main source tree www-supfile //更新FreeBSD 官方網頁 #cp ports-supfile /root/ //複製ports-supfile到root目錄底下 #cd /root //切換到root目錄底下 #vi ports-supfile //修改ports-supfile內容
修改以下內容 default host CHANGE_THIS.FreeBSD.org //官方站台(預設值) default host cvsup.tw.freebsd.org //改為國內站台交大資工如此下載速度較快(還有cvsup1~13都可使用)
#rehash #cvsup -g -L 2 ports-supfile //更新ports-tree
———————-省略——————————- Shutting down connection to server Finished successfully //看到上面訊息代表更新成功 #portsdb -Fu //當每次採用 CVSup 更新完 port tree 後,執行portsdb -Fu 來及時更新您的 port INDEX資料庫
portupgrade -r pkg_name 升级单个软件和与其相关的 其中 pkg_name 是 pkg_info 中显示的名字
portupgrade -ar 就会自动更新全部了。 如果加上 P 参数,则先看是否有已经编译好的 pkg 下载,直接从 pkg 升级,省去自己编译。 下载站点可以通过修改 /usr/local/etc/pkgtools.conf 更改
portupgrade -arR 升级所有已经安装的软件,并且检查依赖关系
使用 Ports 系统1 查询比如,你想知道 ports 中是否有 pidgin 这个软件,那么可以这样:$cd /usr/ports$make search key=pidgin同样也可以使用$cd /usr/ports$make search name=pidgin/usr/ports/README 中还有更多的例子可以参考。2 安装非常简单。比如你要安装 firefox,那么作为超级用户 root:#cd /usr/ports/www/firefox#make install clean3 卸载要卸载 firefox 的话:#cd /usr/ports/www/firefox#make deinstall clean4 升级要升级 firefox:#cd /usr/ports/www/firefox#make deinstall reinstall clean用ports安装东东很简单,但是有的时候在安装完后就会忘记make clean make distclean,一个一个找好麻烦,OK,follow me..... 先删除make world和编译内核留下的垃圾文件 rm -r /usr/obj/*常用的 Ports 管理工具portsnap这是推荐的升级 Ports 系统树的工具。portupgrade相当好用的升级 Ports 中软件的 Ruby 工具。支持从源码/包升级。pkg 工具FreeBSD 基本系统中自带的包管理工具。方便实用。都是 pkg_* 类型的系统命令,比如 pkg_add, pkg_delete 之类的!2.安装个小东西,可以升级soft,也可做清理 cd /usr/ports/sysutils/portupgrade && make install clean portupgrade升级soft portupgrade -riv -m `参数,如WITH_MYSQL=yes` vpopmail 下面进行清理 portsclean -C Cleaning out /usr/ports/*/*/work... 完成每个目录下的make clean功能 portsclean -DD Detecting unreferenced distfiles... [Rebuilding the pkgdb in /var/db/pkg ... - 33 packages found (-0 +33) ................................................................ done] 删除不存在于pkg_info中的/usr/ports/distfiles下的文件包 如果想把存在于pkg_info中的distfiles也删了,直接去目录删就好了 rm -r /usr/ports/distfiles/* 还有个portclean,自己man一下吧 man portcleanhttp://4dian.org/post/2/28
