mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-08 21:34:25 +00:00
3.2 KiB
3.2 KiB
NetBSD
- TL;DR
- The
rc.conffiles - Package management
- Enable time sync for the NTP server
- Graphical UI
- VirtualBox Guest Additions
- Linux binary compatibility
- Further readings
TL;DR
# Read manual pages.
man 'man'
man 5 'rc.conf'
# List all available man pages.
man -w 'time'
# Read all available man pages.
man -a 'time'
# Search for keywords in the manual page descriptions.
man -k 'mail'
# Change the keyboard's layout.
wsconsctl -kw encoding=it
# Edit files.
vi 'path/to/file'
# Become 'root' from user sessions.
# The user must know root's password *and* be member of the 'wheel' group.
# Use '-' at the end to also load root's environment.
su
su -
# Add users.
useradd -m 'username'
useradd -mG 'secondary_group' 'username'
# Add new members to groups.
usermod -G 'group_name' 'username'
# Change users' default shell.
chpass -s 'path/to/shell' 'username'
chpass -s "$(grep 'bin/zsh' '/etc/shells')" 'username'
# (Re)start services.
service ntpd restart
service vboxguest restart
# Start services at boot.
echo ntpd_enable="YES" >> '/etc/rc.conf'
echo vboxguest_enable="YES" >> '/etc/rc.conf'
# Upgrade the system to newer *minor* versions.
sysinst
sysupgrade auto 'https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/amd64'
# Upgrade the system to newer *major* versions.
sysinst
sysupgrade fetch 'https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/amd64' \
&& sysupgrade kernel \
&& sysupgrade modules \
&& reboot \
&& sysupgrade sets \
&& sysupgrade etcupdate \
&& sysupgrade clean \
&& reboot
# Initialize the package managers.
export PKG_PATH="https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d '_' -f '1')/All"
# Install packages the basic way.
pkg_add -v 'git'
pkg_add -v 'pkgin'
# Install packages using `pkgin`.
pkgin install 'firefox'
pkgin in 'sqlite3'
# Refresh the packages database.
pkgin update
pkgin up
# Search for packages.
pkgin search 'fish'
pkgin se 'boinc'
# Upgrade packages.
pkgin upgrade
pkgin ug
# List installed packages.
pkgin list
pkgin ls
# List files in packages.
pkgin pkg-contents
pkgin pc
# *Gently* reboot the system.
shutdown -r now
shutdown -r +30 "System will reboot"
# *Gently* shutdown the system.
# `poweroff` is equivalent to `shutdown -p now`.
shutdown -p +5
poweroff
The rc.conf files
TODO
Package management
Upgrade the system
TODO
Manage ports from the Ports collection
TODO
Enable time sync for the NTP server
sysrc ntpd_enable="YES"
sysrc ntpd_sync_on_start="YES"
Graphical UI
TODO
VirtualBox Guest Additions
TODO
Linux binary compatibility
TODO