- 论坛徽章:
- 13
|
本帖最后由 ulovko 于 2013-04-06 11:09 编辑
FROM: http://blog.chinaunix.net/uid-25256412-id-3233391.html
1> 安装 OpenBSD5.1 的准备工作
下载地址:ftp://ftp.openbsd.org/pub/OpenBSD/5.1/amd64/install51.iso
官方最新FAQ:ftp://ftp.openbsd.org/pub/OpenBSD/doc/history/obsd-faq49.pdf
官方最新PF:ftp://ftp.openbsd.org/pub/OpenBSD/doc/history/pf-faq49.pdf
简体中文FAQ 4.6:
obsd_FAQ46.zip
(424.82 KB, 下载次数: 218)
简体中文FAQ 4.8:
obsd_FAQ48.zip
(365.37 KB, 下载次数: 186)
=== OpenBSD5.1 系统配套歌曲 ===
MP3格式:ftp://ftp.openbsd.org/pub/OpenBSD/songs/song51.mp3
OGG格式:ftp://ftp.openbsd.org/pub/OpenBSD/songs/song51.ogg
=== OpenBSD5.1 系统配套歌曲 ===
2> 请开始安装 OpenBSD5.1
安装教程:http://www.openbsd.org/faq/faq4.html#InstStart
启动计算机开始安装:
重启计算机:
使用刚刚创建的普通用户登陆:
登陆后查看邮件:
切换到root,向dmesg@openbsd.org发送机器信息为社区的发展尽一份心力(PS: 不要老发虚拟机信息)!
# visudo (如图中所示,允许wheel组使用sudo ^_^)
测试 sudo是否配置成功:
3> 简单认识OpenBSD5.1
- # cat /etc/myname (查看主机名)
- obsd5.kotzu.org
- # cat /etc/hostname.em0 (查看网卡配置)
- dhcp
- # cat /etc/hostname.em0 (静态地址会是这样)
- 192.168.1.11 255.255.255.0 NONE NONE (依次是:inet ipaddress netmask broadcastaddress options)
- # cat /etc/mygate (配置网关地址)
- 192.168.1.1
- # cat /etc/resolv.conf (配置DNS)
- search kotzu.org
- nameserver 202.106.46.151
- nameserver 202.106.0.20
- lookup file bind
-
复制代码 4> 关于boot菜单 /etc/boot.conf
- boot> set timeout 60 (boot delay, 5 seconds by default)
- boot> boot -s (To boot into single-user mode)
- #/bin/sh /etc/netstart (Start the network while in single-user mode)
- boot> boot -s /bsd.old (To boot an old kernel in single-user mode)
- # man boot
- FILES
- /usr/mdec/biosboot first stage bootstrap
- /usr/mdec/pxeboot PXE bootstrap
- /boot system bootstrap
- /etc/boot.conf system bootstrap's startup file
- /bsd kernel image
- /bsd.sp kernel image for single processor machines
- /bsd.mp kernel image for multiprocessor machines
- /bsd.rd kernel image for installation/recovery
- EXAMPLES
- Boot the default kernel:
- boot> boot
- Remove the 5 second pause at boot-time permanently, causing boot to load
- the kernel immediately without prompting:
- # echo "boot" > /etc/boot.conf
- Use serial console. A null modem cable should connect the specified
- serial port to a terminal. Useful for debugging.
- boot> set tty com0
- Invoke the serial console at every boot:
- # echo "set tty com0" > /etc/boot.conf
复制代码 5> 使用本地化语言(简体中文)
- $ ls /usr/share/locale/zh_
- zh_CN.GB18030/ zh_CN.eucCN/ zh_TW.Big5/ zh_TW.eucTW/
- zh_CN.UTF-8/ zh_TW.BIG5/ zh_TW.UTF-8/
- $ vim ~/.profile
- export LANG="zh_CN.UTF-8"
- export LC_CTYPE="zh_CN.UTF-8" (字符类型)
- export LC_COLLATE="zh_CN.UTF-8" (字符对比规则)
- export LC_TIME="zh_CN.UTF-8" (时间类型)
- export LC_NUMERIC="zh_CN.UTF-8" (数字类型)
- export LC_MONETARY="zh_CN.UTF-8" (货币类型)
- export LC_MESSAGES="zh_CN.UTF-8" (消息/提示类型)
- export LC_ALL="zh_CN.UTF-8"
- :wq
- $ exit (注销生效)
- 恭喜阁下终于看到母语了^_^
- --------------------------------------------4.8之前的版本可能要用zh_CN.eucCN
- # cd /usr/src/share/locale/ctype
- # vim Makefile
- LOCALES += zh_CN.eucCN
- LOCALESRC_zh_CN.eucCN = zh_CN.eucCN
- LOCALES += zh_CN.UTF-8
- LOCALESRC_zh_CN.UTF-8 = en_US.UTF-8
- :wq
- # cd ..
- # make && make install && make clean
复制代码 About eucCN: http://zh.wikipedia.org/wiki/EUC
6> 配置PACKAGE & PORTS & SRC
PACKAGE:- $ vi ~/.profile
- export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/5.1/packages/`machine -a`/
- # export PKG_PATH=ftp://ftp.jaist.ac.jp/pub/OpenBSD/5.1/packages/`machine -a`/
- export FETCH_PACKAGES=yes
- :wq
- $ exit (注销生效)
- $ sudo pkg_add -v axel (安装axel)
- axel-2.4 : libiconv-1.14: ok
- axel-2.4 : gettext-0.18.1p1: ok
- axel-2.4 : ok
- $ axel -V
- Axel version 2.4 (OpenBSD)
- Copyright 2001-2002 Wilmer van der Gaast.
-
- $ sudo pkg_add -v wget (安装wget)
- wget-1.13.4 : libidn-1.22: ok
- wget-1.13.4 : ok
- $ wget -V
- GNU Wget 1.13.4 built on openbsd5.1.
- ...
- ...
复制代码 PORTS & SRC:
- # axel -a 'ftp://ftp.openbsd.org/pub/OpenBSD/5.1/src.tar.gz' (下载src)
- # axel -a 'ftp://ftp.openbsd.org/pub/OpenBSD/5.1/sys.tar.gz' (下载sys)
- # axel -a 'ftp://ftp.openbsd.org/pub/OpenBSD/5.1/ports.tar.gz' (下载ports)
- # axel -a 'ftp://ftp.openbsd.org/pub/OpenBSD/5.1/xenocara.tar.gz' (里面包含显卡驱动)
- # cd /usr/src
- # tar -zxvpf ~/src.tar.gz (Installing the Source Code)
- # tar -zxvpf ~/sys.tar.gz (Installing the Sys Code)
- # cd /usr
- # tar -zxvpf ~/ports.tar.gz (Installing the Ports Collection)
- # tar -zxvpf ~/xenocara.tar.gz (Installing the Drivers Collection)
-
复制代码 Customizing Download Sources:
- # cd /usr/ports/infrastructure/templates
- # cp network.conf.template ../db/network.conf
- # vi ../db/network.conf (其实默认的就不错,哥们你看着办吧^_^)
- # vim /etc/mk.conf
- WRKOBJDIR=/usr/obj/ports
- DISTDIR=/usr/distfiles
- PACKAGE_REPOSITORY=/usr/packages
- FETCH_CMD=/usr/local/bin/axel -a -S4
- MASTER_SITE_OVERRIDE=\
- ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${DIST_SUBDIR}/\
- ftp://ftp.jaist.ac.jp/pub/OpenBSD/distfiles/${DIST_SUBDIR}/
- :wq
复制代码- The working directory of ports. This is controlled by the WRKOBJDIR variable, which specifies the directory which will contain the working directories.
- The directory containing distribution files. This is controlled by the DISTDIR variable.
- The directory containing newly built binary packages. This is controlled by the PACKAGE_REPOSITORY variable.
7> PKG_ADD & PORTS 安装 VIM
ports安装 VIM:
- # cd /usr/ports
- # make print-index
- # grep -i ^vim INDEX (Finding Software by Name)
- # make search key=vim (Finding by Keyword)
- ...
- ...
- Port: vim-7.3.154p2-no_x11
- Path: editors/vim,-main,no_x11
- Info: vi clone, many additional features
- Maint: Chris Kuethe <ckuethe@openbsd.org>
- Index: editors
- L-deps: STEM->=0.10.38:devel/gettext converters/libiconv
- B-deps: STEM->=0.10.38:devel/gettext STEM->=1.21:textproc/groff archivers/bzip2
- R-deps: STEM->=0.10.38:devel/gettext
- Archs: any
- ...
- ...
- (L-deps->:libraries used by this port B-deps->:lists software that is required to build this port
- R-deps->:non-library software that must be present to actually run this port)
- # cd editors/vim && make install clean
复制代码 package安装 VIM:
- # man pkg_add
- pkg_add can be used to install new packages, to replace existing packages with other flavors
- (option -r) or to update packages to newer versions (option -u) [PS:这个跟FreeBSD可不同哦!]
- # vi ~/.profile (注意这里是root,也需要配置!)
- export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/5.1/packages/`machine -a`/
- export FETCH_PACKAGES=yes
- :wq
- # exit (注销生效)
- # pkg_add -v vim (安装VIM)
- Ambiguous: vim could be vim-7.3.154p2-no_x11 vim-7.3.154p2-gtk2
- (很人性化吧,还有提示的哟!你会发现ports里面抓,和现在都有这么多不同的vim?
- OpenBSD称之为Flavors! 其实就是不同的Option罢了^_^, 闲言少叙,书归正转!)
- # pkg_add -v vim-7.3.154p2-no_x11
- vim-7.3.154p2-no_x11: ok
- # vim --version
- VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 13 2012 07:40:51)
- Included patches: 1-8, 11-20, 22-26, 28-34, 38-50, 52-62, 65-78, 80-84, 86, 88-94
- ...
- ...
- # vim ~/.vimrc
- set nomodeline (这个一定要写,目前有这个安装漏洞)
- set nocp
- set hls is
- set ic
- set cindent
- set autoindent
- set backspace=2
- set nobackup
- set noswapfile
- set shiftwidth=2
- set tabstop=2
- set softtabstop=2
- set expandtab
- set ruler
- set mouse=v
- syntax on
- "set bg=dark (更改背景色调/默认为light, " 为注释!)
- :wq (详情:vimtutor)
- # cp .vimrc ~ko/.vimrc (给普通用户也送一份)
- # chown -R ko:ko ~ko/ (更改为合适的权限)
复制代码 Customizing Alias:
- $ vim ~/.profile
- #
- # sh/ksh initialization
- set autolist
- alias cl='clear'
- alias df='df -h'
- alias la='ls -la'
- alias lh='ls -lh'
- alias lf='ls -FA'
- alias ll='ls -l'
- :wq
- $ exit (注销生效)
复制代码 X> Reserved for future use....
Basic FreeBSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751834-1-1.html
Basic NetBSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751787-1-1.html
Basic OpenBSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751016-1-1.html
Basic Debian Setup as Desktop: http://bbs.chinaunix.net/thread-3751791-1-1.html
Basic Ubuntu Setup as Desktop: http://bbs.chinaunix.net/thread-3746337-1-1.html
Basic Fedora Setup as Desktop: http://bbs.chinaunix.net/thread-3761672-1-1.html
Basic PC-BSD Setup as Desktop: http://bbs.chinaunix.net/thread-3751857-1-1.html
|
评分
-
查看全部评分
|