시스템 설정

사용자를 sudo, su 가능하게

wheel 그룹에 추가

pw group mod wheel -m lesstif
CODE

sudo 는 pkg 로 별도 패키지 설치해야 가능하며 설치후 visudo 사용( sudo 명령어 사용법 참고)


static ip

vi /etc/rc.conf
BASH


IP 정보 추가

ifconfig_em0="inet 192.168.11.230 netmask 255.255.255.0"
defaultrouter="192.168.11.2"
CODE


재시작

 /etc/rc.d/netif restart && /etc/rc.d/routing restart
CODE


Sendmail disable

부팅시 시간이 오래 걸리므로 중지(/etc/rc.conf)

/etc/rc.conf

sendmail_enable="NONE"
CODE


Vmware tools install


sudo pkg install open-vm-tools-nox11  
CODE


OVT upgrade(구동 결과 확인)

$ sudo ps -fU root | grep vmtoolsd

951  -  S    0:00.08 /usr/local/bin/vmtoolsd -c /usr/local/share/vmware-tools/tools.conf -p /usr/local/lib/open-vm-tools/plugins/vmsvc
CODE


구동되지 않았다면 다음 명령어로 실행

If the vmtoolsd process is not running, either reboot the system or manually start the vmtools vmsvc process with the command.

sudo /usr/local/etc/rc.d/vmware-guestd start
CODE


Ports

port tree update

이런 메시지 나오면 포트 업데이트. Please update your ports tree and try again. 

portsnap fetch update
CODE
portsnap extract
CODE
portsnap update
CODE


Package Manager

기본적으로 pkg_info/pkg_create/pkg_add  3종 세트를 제공하지만 pkgng 를 권장하고 있음.

pkgng 설치

root 로 pkg 명령을 실행하면 다음과 같이 설치하겠냐고 물음.

$ pkg

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: 
CODE


설치

필수 패키지

sudo pkg install -y sudo vim bash lsof bind-tools stow curl wget git
CODE


GNU utils

sudo pkg install -y findutils coreutils
CODE


PHP

sudo pkg install -y php74-exif php74-gd php74-mbstring php74-xml php74-mysqli php74-pdo_mysql php74-intl php74-curl php74-fileinfo php74-gmp php74-iconv php74-pdo_sqlite php74-tidy php74-xml php74-dom php74-composer php74-xmlwriter php74-tokenizer php74-session php74-readline php74-zip php74-simplexml php74-sqlite3
BASH

FreeBSD 에 GNU Util 을 설치하면 모두 g가 붙는다.(예: awk → gawk, dircolors → gdircolors) 그래서 BSD 계열의 커맨드가 실행되거나 dircolors 같이 command not found 가 날 수 있다.

이를 방지하려면 아래 스크립트를 실행해서 g 를 뺀 이름을 symbolic link 하도록 하고 /usr/local/bin 을 PATH 의 제일 앞에 넣자.



Update

패키지 카탈로그 업데이트

sudo pkg update
BASH

PHP 7.4 패키지 목록 출력

sudo pkg search php74|grep ^php
BASH


which

특정 파일이 어떤 패키지에서 비롯됐는지 확인

$ pkg which /usr/local/etc/php.conf 

/usr/local/etc/php.conf was installed by package php74-7.4.8
BASH


Upgrade

freebsd-update fetch
freebsd-update install
BASH


이제 업그레이드할 버전을 -r 옵션으로 target 명시

freebsd-update upgrade -r 13.0-RELEASE
freebsd-update install
BASH


설치 완료후에는 재부팅 필요

shutdown -r now
BASH



See Also