Port更新:#cvsup -g -L 2 /root/ports-supfile
ports数据库维护:#cd /usr/ports/
# make fetchindex
/usr/ports/INDEX-6.bz2 100% of 772 kB 7429 Bps 00m00s
# portsdb -u
[Updating the portsdb
in /usr/ports ... - 14798 port entries found .........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000....... ..... done]
Port更新的新方法 据说可以免除上面维护数据库时产生的各种麻烦
使用portsnap工具 是通过http下载压缩后的port数据,免除使用cvsup的协议支持以及更新速度问题
第一次使用
#vi /etc/portsnap.conf
把里面的SERVERNAME=xxx 改成
SERVERNAME=portsnap.cn.FreeBSD.org 来提高下载速度
#portsnap fetch
#portsnap extract
以后只要定期手动运行
#Portsnap updata
手册中说明了,如果要cron来定期运行 一定要使用
Portsnap cron 参数来做,不要使用 updata参数
Port安全审计:
安装
cd /usr/ports/security/portaudit
make install clean
cd /usr/ports/security/portaudit-db
make install clean
cd /usr/ports/security/vuxml
make install clean
通过下面的命令来更新数据库,并查看目前安装的软件包中所存在的已知安全漏洞
portaudit -Fda
伤感星星的执行结果
# portaudit -Fda
auditfile.tbz 100% of 35 kB 3810 Bps
New database installed.
Database created: 2006年 5月28日 星期日 17时10分19秒 CST
0 problem(s) in your installed packages found.
每次通过ports安装软件就不会出现vulnerbility check disabled 提示
Port 的文件清理
portsclean -C 清理编译后生成的临时文件,主要是指work目录中的
portsclean -DD 清理 /usr/src/distfile 目录; 在升级已安装的port到新版后,旧的源代码还遗留在此占据空间
伤感星星的执行结果:
# portsclean -C
Cleaning out /usr/ports/*/*/work...
# portsclean -DD
Detecting unreferenced distfiles...
[Updating the pkgdb in /var/db/pkg ... - 112 packages found (-1 +9) (...)......... done]
Delete /usr/ports/distfiles/SDL-1.2.9.tar.gz
Delete /usr/ports/distfiles/aalib-1.4rc5.tar.gz
Delete /usr/ports/distfiles/arc-5.21n.tgz
Delete /usr/ports/distfiles/cups-1.1.23-source.tar.bz2
Delete /usr/ports/distfiles/gnome2/pkg-config-0.20.tar.gz
Delete /usr/ports/distfiles/rpm/i386/8.0/glibc-common-2.3.2-4.80.8.i386.rpm
Delete /usr/ports/distfiles/rpm/i386/8.0/redhat-release-8.0-8.noarch.rpm
Delete /usr/ports/distfiles/samba-3.0.20b.tar.gz
Delete /usr/ports/distfiles/unrarsrc-3.5.4.tar.gz
Delete /usr/ports/distfiles/rpm/i386/8.0
Delete /usr/ports/distfiles/rpm/i386
Delete /usr/ports/distfiles/rpm