#/etc/netstart 刷新网络配置
#sh /etc/rc 刷新整个rc
#ee /boot/loader.conf
hint.apic.0.disabled=1
FreeBSD学习杂记 (packages and ports)国内有快点的packagesite
setenv PACKAGEROOT ““ OR
setenv PACKAGESITE “”
在/etc/profile 里设
export PACKAGESITE OR
export PACKAGEROOT
#whereis ****
产生所有port信息的索引文件:# cd /usr/ports
# make print-index > index.txt
# cd /usr/ports
# make readmes
->安装 pkg_add package name
->移除 pkg_delete package name
#注意:只有.tgz的才是package ,.tar.gz的是source
cd /usr/ports/editors/joe/
make fetch #仅会将 joe 的 tarball下载下来
make fetch-recursive #会将此 ports 的 tarball 与所有须要的其他 ports 的 tarball,下载至 /usr/ports/distfiles/ 目录下
cd /usr/ports/
make fetch
# cd /usr/ports/directory
# make extract
# cd /usr/ports/directory
# make fetch-list
cd /usr/ports/editors/joe/
make deinstall
或是使用 pkg_delete
cd /var/db/pkg/
pkg_delete joe-{version}
#如果有相依性无法删除的话, pkg_delete -f joe-{version} 强制删除
cd /usr/ports/
make search key=ldap
make search name=ldap
#知道软件名用这个
cd /var/db/pkg/
pkg_delete joe-{version}
cd /usr/ports/editors/joe/
make install
或是
cd /usr/ports/editors/joe/
make clean
make reinstall
pkg_info
查询某个档案是属於哪些套件pkg_info -W /usr/local/bin/joe
查询某个套件安装了哪些档案pkg_info -xL /var/db/pkg/joe-{version}
列出所有可以升级的 portspkg_version -c
如何手动加入编译 ports 的叁数cd /usr/ports/ftp/pure-ftpd/
make CONFIGURE_ARGS+=”-without-inetd” install
cd /usr/ports/editors/joe/
make PREFIX=/usr install
# cd /usr/ports/directory
# make rmconfig
# make config
# cd /usr/ports/somewhere/frobble
# make extract
# cd work/frobble-2.8
[Apply your patches]
# cd ../..
# make package
pkg_add joe-{version}.tgz #安装 packages
pkg_add -f joe-{version}.tgz #强制安装 packages
cd /usr/ports/ && make index #更新 INDEX 对照表
cd /usr/ports
make fetchindex
echo ‘MASTER_SITE_BACKUP?=ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/’ >> /etc/make.conf
echo ‘MASTER_SITE_OVERRIDE?= $(MASTER_SITE_BACKUP)’ >> /etc/make.conf