利用CVSUP更新Port Tree

 

#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 clean
3 卸载
要卸载 firefox 的话:
#cd /usr/ports/www/firefox
#make deinstall clean
4 升级
要升级 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 portclean
http://4dian.org/post/2/28

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值