openbsd_series_01

网络配置

OpenBSD的IP设置在/etc/hostname.xxx文件,其中xxx就是你的网卡名。网关设置在/etc/mygate文件。DNS设置在/etc/resolv.conf文件中。
在/etc/hostname.xxx中
DHCP NONE NONE NONE
或者
inet 192.168.0.2 255.255.255.0 202.86.128.86
在/etc/mygate中,如果是dhcp的话,就不要这个文件了.
192.168.0.1
在/etc/resolv.conf中,如果是dhcp的话,就不用变这个.
202.96.128.86
你既可以重起计算机也可以运行/etc/netstart脚本。你只要简单的输入(作为root):

sh /etc/netstart

我们应该首先考虑Packages System来安装软件

Package System

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- set PKG_PATH
openbsd66# pkg_add -v bash-5.0.11.tgz
quirks-3.182 signed on 2019-10-12T12:14:24Z
quirks-3.182: ok
bash-5.0.11:libiconv-1.16p0: ok
bash-5.0.11:gettext-runtime-0.20.1p0: ok
Shell /usr/local/bin/bash appended to /etc/shells
bash-5.0.11: ok
Extracted 12724009 from 12725930

openbsd66# pkg_info
bash-5.0.11 GNU Bourne Again Shell
gettext-runtime-0.20.1p0 GNU gettext runtime libraries and programs
libiconv-1.16p0 character set conversion library
portslist-7.26 full list of pkgpaths in ports
quirks-3.182 exceptions to pkg_add rules
vim-8.1.2061-no_x11 vi clone, many additional features
openbsd66# pkg_add -v https://mirrors.cloud.tencent.com/OpenBSD/6.6/packages>
Update candidates: quirks-3.182 -> quirks-3.182
quirks-3.182 signed on 2019-10-12T12:14:24Z
git-2.23.0:nghttp2-1.39.2: ok
git-2.23.0:curl-7.66.0: ok
git-2.23.0:p5-Error-0.17025: ok
git-2.23.0:cvsps-2.1p2: ok
git-2.23.0: ok
The following new rcscripts were installed: /etc/rc.d/gitdaemon
See rcctl(8) for details.
New and changed readme(s):
/usr/local/share/doc/pkg-readmes/git
Extracted 51529180 from 51531851

configure ports

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
openbsd66# ftp https://mirrors.cloud.tencent.com/OpenBSD/6.6/ports.tar.gz
openbsd66# tar zxvf /tmp/ports.tar.gz -C /usr/
openbsd66# cd /usr/
openbsd66# ls
X11R6 games lib libexec mdec ports share xobj
bin include libdata local obj sbin src
openbsd66# cd ports/
openbsd66# ls
.cvsignore cad games math shells
CVS chinese geo meta sysutils
Makefile comms graphics misc telephony
README converters infrastructure multimedia tests
archivers databases inputmethods net textproc
astro devel japanese news www
audio editors java plan9 x11
benchmarks education korean print
biology emulators lang productivity
books fonts mail security

获得ports

1
2
cd /usr
sudo cvs -qd anoncvs@anoncvs.jp.openbsd.org:/cvs get -P ports

更新ports

1
2
cd /usr/ports/
sudo cvs -qd anoncvs@anoncvs.jp.openbsd.org:/cvs up -Pd

利用ports安装软件

1
2
3
cd /usr/ports
cd target_dir
make install clean