FreeBSD 与 RISC-V: 开源物联网生态系统的未来
# DHCP
sysrc ifconfig_vmx0=DHCP
# static
sysrc ifconfig_vmx0="inet 172.16.32.61 netmask 255.255.255.0"
# gateway
sysrc defaultrouter="172.16.32.1"
# disable sendmail
sysrc sendmail_enable=NONE
sysrc sendmail_submit_enable=NO
sysrc sendmail_outbound_enable=NO
sysrc sendmail_msp_queue_enable=NO
# enable sshd
sysrc sshd_enable=YES
~/.tcshrc
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin $HOME/work /usr/local/go/bin)
set prompt = "[%N@%m:%~]%# "
# history
set history = 100
set savehist = 100
# autocomplete
set autolist
set complete = enhance
set autoexpand
set correct = cmd
set correct = all
alias vim 'nvim'
alias ls 'ls --color=always'
alias l 'ls -l'
alias mv 'mv -i'
alias cp 'cp -i'
alias rm 'rm -i'
setenv GREP_OPTIONS --color=auto
# 允许 root ssh 远程
sed -e 's|^#PermitRootLogin no|PermitRootLogin yes|g' -i.bak /etc/ssh/sshd_config
service sshd restart
mkdir -p /usr/local/etc/pkg/repos
cat >> /usr/local/etc/pkg/repos/FreeBSD.conf << EOF
FreeBSD: {
url: "pkg+http://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly",
}
EOF
pkg update -f
pkg upgrade
portsnap extract
portsnap fetch
portsnap update
pw useradd -m -s /bin/sh -n skylens
pw userdel -r -n skylens
pkg install -y sudo
pw groupmod wheel -m skylens
!!! vim 包及相关的依赖太多,不建议安装,可以使用 neovim
删除 vim
pkg remove `cat vimdeps.txt`
pkg install -y pkg wget git nano aria2 tmux neovim
mkdir -p ~/.config/nvim
cd ~/.config/nvim
cat > init.vim << EOF
set paste
colorscheme delek
EOF
# 查看当前版本
freebsd-version -k
# 更新
/usr/sbin/freebsd-update fetch
/usr/sbin/freebsd-update -r 12.2-RELEASE upgrade
/usr/sbin/freebsd-update install
reboot
/usr/sbin/freebsd-update install
如果有使用 bash 作为默认 shell,需要删除 bash ( pkg remove bash ),不然会报错
freebsd 12 升级到 freebsd 13
freebsd-version -k
/usr/sbin/freebsd-update -r 13.0-RELEASE upgrade
/usr/sbin/freebsd-update install
reboot
pkg-static install -f pkg