NetBSD 从pkgsrc安装软件

netbsd安装软件是靠pkgsrc 这个框架是从freebsd移植过来的
(Both the NetBSD packages collection and the NetBSD package system are
derived from FreeBSD. from /usr/pkgsrc/Packages.txt)
从pkgsrc安装软件也非常的简单。
make
make install
make clean-depends

1,pkgsrc可以通过到ftp://ring.asahi-net.or.jp/pub/NetBS...��下载tar.gz
cd /usr
tar zxpf pkgsrc.tar.gz
2,也可以通过cvs更新,简单的说一下cvs
对普通用户来说,只需要记住以下:man cvs
第一次使用checkout:

cd /usr/;cvs checkout pkgsrc

以后更新pkgsrc:
cd /usr/pkgsrc;cvs update -dP

更新某一目录:
cd /usr/pkgsrc/path/to/;cvs update -dP
还有其他方法.

-----------------有用的工具---------------------------
1,pkgfind 查找软件
#cd /usr/pkgsrc/pkgtools/pkgfind
#make install clean-depends

netbsd: {10} pkgfind xorg
fonts/xorg-fonts100dpi: X.org 100dpi bitmap fonts
fonts/xorg-fonts75dpi: X.org 75dpi bitmap fonts
fonts/xorg-fontsCyrillic: X.org Cyrillic bitmap fonts
fonts/xorg-fontsEncodings: X.org Encoding fonts
fonts/xorg-fontsMisc: X.org miscellaneous bitmap fonts
fonts/xorg-fontsTruetype: X.org Truetype fonts
fonts/xorg-fontsType1: X.org Type1 fonts
fonts/xorg-fontserver: X.org font server
meta-pkgs/xorg: X.org meta-package
misc/xorg-docs: X.org Documentation
x11/xorg-clients: X.org client programs and related files
x11/xorg-imake: Imake and other utilities from X.org
x11/xorg-libs: X.org Libraries
x11/xorg-server: X.org X server and related programs

2,pkglint
#pkgfind pkglint
#cd /usr/pkgsrc/pkgtools/pkglint
#make install clean-depends

用法:lintpkgsrc -i 检查是否有更新的版本 man lingpkgsrc
netbsd:lintpkgsrc -i
Scanning Makefiles: 4866 packages
Unknown package: 'Xrandr' version 1.0.2

3, cpuflags
优化编译
/etc/mk.conf控制编译的一些状态.而cpuflags 根据用户的环境自动优化.
#pkgfind cpu
netbsd: {18} pkgfind cpu
devel/cpuflags: Determine compiler flags to best target current cpu
print/gimp-print-escputil: Epson Stylus inkjet printer tool
sysutils/cpuburn: CPU load testing utilities for Pentium pro and later
sysutils/cpuid: CPU identification feature
sysutils/wmcpuload: Dockable CPU monitor
sysutils/xfce4-cpugraph-plugin: XFce4 CPU load plugin

#cd /usr/pkgsrc/devel/cpuflags
#make install clean-depends
然后加入下面到/etc/mk.conf
#touch /etc/mk.conf
.sinclude "/usr/pkg/share/mk/cpuflags.mk"
.sinclude "/usr/pkg/share/mk/optimize_gcc.mk"
4,pkgclean
快速清除work
cd /urs/pkgsrc/pkgtools/pkgclean
make install clean-depends
用法:
pkgclean

还有很多有用的工具,自己体会吧。我的mk.conf
netbsd: {19} more /etc/mk.conf
.sinclude "/usr/pkg/share/mk/cpuflags.mk"
.sinclude "/usr/pkg/share/mk/optimize_gcc.mk"
FETCH_CMD= /usr/pkg/bin/wget -cT 20
#--------------for master_site_backup------------------
MASTER_SITE_BACKUP?= \
ftp://ring.asahi-net.or.jp/pub/NetBS...es/distfiles/\
ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/\
ftp://ftp.FreeBSD.org/pub/FreeBSD/distfiles/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
#--------------for master_site_backup------------------
#MKX11=yes
ACCEPTABLE_LICENSES+=no-commercial-use
ACCEPTABLE_LICENSES+=unrar-license
ACCEPTABLE_LICENSES+=citrix_ica-license

特别说的是我用wget 替代了系统自己的ftp,来下载distfiles
------------------------软件的更新-----------------------
如果lintpkgsrc发现有更新的版本。
那么可能需要更新,这个看你自己是否喜欢追新了。
1,make update
这个方法是更新软件并更新所有依赖这个软件的软件。所以不建议经常使用。
2,make replace
这个方法只是更新本软件。
不建议使用make deinstall make reinstall
-------------------------软件的删除----------------------
pkg_delete -vd xxx
删除本软件
pkg_delete -vdr 删除本软件和依赖本软件的软件,小心使用。
-------------------------软件的信息管理--------------------
pkg_info
列出已经安装的软件
pkg_info -dL xx
列出xx软件的介绍信息和安装的所有相关文件.
netbsd: {42} pkg_info -dL wget
Information for wget-1.9.1nb1:

Description:
Wget [formerly known as Geturl] is a freely available network utility
to retrieve files from the World Wide Web using HTTP and FTP, the two
most widely used Internet protocols. It works non-interactively, thus
enabling work in the background, after having logged off.

The recursive retrieval of HTML pages, as well as FTP sites is
supported -- you can use Wget to make mirrors of archives and home
pages, or traverse the web like a WWW robot (Wget understands
/robots.txt).

Homepage:
http://www.gnu.org/software/wget/wget.html

Files:
/usr/pkg/info/wget.info
/usr/pkg/info/wget.info-1
/usr/pkg/info/wget.info-2
/usr/pkg/info/wget.info-3
/usr/pkg/info/wget.info-4
/usr/pkg/bin/wget
/usr/pkg/man/man1/wget.1
/usr/pkg/share/locale/bg/LC_MESSAGES/wget.mo
/usr/pkg/share/locale/ca/LC_MESSAGES/wget.mo
/usr/pkg/share/locale/cs/LC_MESSAGES/wget.mo
/usr/pkg/share/locale/da/LC_MESSAGES/wget.mo
/usr/pkg/share/locale/de/LC_MESSAGES/wget.mo
/usr/pkg/share/locale/el/LC_MESSAGES/wget.mo ......
查找
pkg_info|grep xx
依赖关系
pkg_info -R xx
------------------------------------------------------------------------
另外netbsd 将一些依赖关系特强的集中在一起,这个就是meta-pkgs

netbsd: {43} cd /usr/pkgsrc/meta-pkgs
netbsd: {44} ls
CVS gnome gnustep web-server
Makefile gnome-accessibility gtk2-extras windowmaker-desktop
README.html gnome-base kde3 xfce4
XFree86 gnome-devel netbsd-doc xfce4-extras
edesktop gnome-extras netbsd-doc-print xorg
fxtv-capture gnome1 netbsd-www
============================================================
这些软件主要是x系统如xfree86,xorg
桌面环境gnome kde等。
------------------------------
我使用netbsd做桌面环境只有1个星期的时间(都晚上),所有有很多地方不太明白,这个东西希望对使用netbsd的初学者有所帮助。
另外说的是,默认情况下,我在同样计算机情况下,感得netbsd-current比freebsd 5.x(我已经优化)更快,或许更稳定。
=============================
netbsd-current的中文支持已经很好。中文输入有待加强。

到如下地址下载pkgsrc.tar.gz,跟freebsd的ports一样。只是名字不同。

ftp://ftp.cn.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz

下载完后用如下命令解压

tar -zxvf pkgsrc.tar.gz -C /usr

把目录树解压到/usr下面,以后要装什么软件自己到/usr/pkgsrc目录里找。比如要装bash

#cd /usr/pkgsrc/shells/bash2

#make clean && make install

猜你喜欢

转载自deepfuture.iteye.com/blog/1416823
今日推荐