s0xxx
07-03-2008, 09:08 PM
Ok, these are some of commands (or sequence of commands) that one forgets easily, especially if using several operating systems (or is it just me :D). As commands can differ in older and newer versions of OS we will asume the commands are valid for FreeBSD 7, NetBSD 4 and OpenBSD 4. I sure have made mistakes somewhere so I would kindly ask you to report it so I could make corrections. Or give suggestions to improve it. ;) List will be updated.
Updating source code
FreeBSD
Using csup:
*default tag=RELENG_7
*default host=cvsup2.FreeBSD.org
*default prefix=/usr
*default base=/var/db
*default release=cvs delete use-rel-suffix compress
src-all
csup -g -L 2 <supfile>
NetBSD
Using CVS:
cd /usr
export CVS_RSH=ssh
cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot co -r netbsd-4 -P src
cd /usr/src
cvs update -dP
Using csup:
*default host=cvsup.de.NetBSD.org
*default base=/usr
*default prefix=/local/NetBSD-cvs
*default release=cvs
*default delete use-rel-suffix
*default compress
netbsd All available NetBSD collections
netbsd-basesrc The base distribution
netbsd-cryptosrc-us Crypto sources
netbsd-doc Documentation
netbsd-htdocs WWW pages
netbsd-othersrc Other Sources
netbsd-gnusrc GNU Sources
netbsd-pkgsrc Packages
netbsd-sharesrc The /usr/share distribution
netbsd-syssrc The kernel distribution
netbsd-xsrc The X11 distribution
csup -g -L 2 <supfile>
OpenBSD
Using CVS:
cd /usr
export CVSROOT=anoncvs@anoncvs.example.org:/cvs
cvs -d$CVSROOT checkout -rOPENBSD_4_3 -P src
cd /usr/src
export CVSROOT=anoncvs@anoncvs.example.org:/cvs
cvs -d$CVSROOT up -rOPENBSD_4_3 -Pd
Using csup:
# Defaults that apply to all the collections
*default release=cvs
*default delete use-rel-suffix
*default umask=002
*default host=cvsup.uk.openbsd.org
*default base=/cvs
*default prefix=/cvs
# If your network link is a T1 or faster, comment out the following line.
*default compress
OpenBSD-all
#OpenBSD-src
#OpenBSD-www
#OpenBSD-ports
#OpenBSD-x11
#OpenBSD-xf4
#OpenBSD-xenocara
csup -g -L 2 <supfile>
Build and Install Kernel & Userland
FreeBSD
cd /usr/src
make buildworld
make buildkernel KERNCONF=GENERIC
make installkernel KERNCONF=GENERIC
shutdown -r now (boot -s)
cd /usr/src
mergemaster -p
make installworld
mergemaster
NetBSD
mkdir /usr/obj /usr/tools
cd /usr/src
./build.sh -O /usr/obj -T /usr/tools -U -u tools
./build.sh -O ../obj -T ../tools kernel=<KERNEL>
./build.sh -O ../obj -T ../tools -U distribution
su
mv /netbsd /netbsd.old
mv /usr/src/sys/arch/i386/compile/GENERIC/netbsd /netbsd
shutdown -r now
cd /usr/src
su
./build.sh -O ../obj -T ../tools -U install=/
etcupdate
OpenBSD
cd /usr/src/sys/arch/i386/conf
config GENERIC
cd ../compile/GENERIC
make clean && make depend && make
make install
reboot
rm -rf /usr/obj/*
cd /usr/src
make obj
cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
cd /usr/src
make build
Updating software collection (ports tree, pkgsrc)
FreeBSD
Using portsnap:
portsnap fetch
portsnap extract # Only needed the first time you get the ports tree
portsnap update
Using csup:
csup -L 2 ports-supfile # See: /usr/share/examples/cvsup/ports-supfile
make fetchindex or make index # portsdb -F or portsdb -Uu respectively if using portupgrade
NetBSD
Use csup supfile with netbsd-pkgsrc
csup -g -L 2 <supfile>
OpenBSD
Use csup supfile with OpenBSD-ports
csup -g -L 2 <supfile>
Installing binary packages
FreeBSD
export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/.
pkg_add –rv bash2
OpenBSD
export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.3/packages/i386/
pkg_add -v gimp
NetBSD
export PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/4.0/All"
pkg_add –v kde-3.5.7
Installing source packages
All *BSDs
cd /usr/ports/security/sudo
make install clean
FreeBSD
portinstall port # sysutils/portupgrade
Listing installed packages
pkg_info # -v switch for verbosity
Deleting installed packages
pkg_delete
make uninstall
make deinstall
Listing outdated software
FreeBSD
pkg_version –v
portversion -l '<' # sysutils/portupgrade
portmaster -L # sysutils/portmaster
NetBSD
lintpkgsrc –i # pkgtools/lintpkgsrc
pkg_chk –uq # pkgtools/ pkg_chk
OpenBSD
cd /usr/ports/infrastructure/build/
./out-of-date
Updating using binary packages
FreeBSD
portupgrade -PP gnome2
OpenBSD
pkg_add -ui pkgname
NetBSD
pkg_add –uu # -uu attempt to update prerequisite packages also
pkg_chk -b -P ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD-4.0/i386/All -u
pkg_chk –g # Generate a list of all installed packages. Default: ${PKGSRCDIR}/pkgchk.conf
pkg_chk –r # Remove outdated packages
pkg_chk –abk # Update all using packages
pkgmanager
Updating using source packages
FreeBSD
portupgrade -R firefox # ports-mgmt/portupgrade
portmanager x11/gnome2 # ports-mgmt/portmanager
portmaster –a # ports-mgmt/portmaster
OpenBSD
make update
NetBSD
make update
make replace
pkg_rolling-replace
pkg_chk –ask
Various cleaning in ports/pkgsrc directory
FreeBSD
make clear # Remove the expanded source code
make distclean # Remove the port's distfiles and perform the clean target
portsclean -C # Clean all work directories in ports tree
portsclean -D # Clean old distfiles
portsclean -DD # Clean all distfiles not referenced by any port currently installed
OpenBSD
make clean # Clean work directory
make clean=depends # Clean the working directories of all dependencies of the port
make clean=dist # Remove the source distribution set(s) of the port
NetBSD
make clean
make clean-depends # The same as: make clean CLEANDEPENDS=1
Listing softvare with security vulnarabilities
FreeBSD
portaudit –Fda
NetBSD
audit-packages # Retired in favour of pkg_install>=20070714 (2008-01-13)
Originally posted at: http://www.bsd-srbija.org/dokumentacija/doku.php/bsd_lista_referentnih_komandi
Updating source code
FreeBSD
Using csup:
*default tag=RELENG_7
*default host=cvsup2.FreeBSD.org
*default prefix=/usr
*default base=/var/db
*default release=cvs delete use-rel-suffix compress
src-all
csup -g -L 2 <supfile>
NetBSD
Using CVS:
cd /usr
export CVS_RSH=ssh
cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot co -r netbsd-4 -P src
cd /usr/src
cvs update -dP
Using csup:
*default host=cvsup.de.NetBSD.org
*default base=/usr
*default prefix=/local/NetBSD-cvs
*default release=cvs
*default delete use-rel-suffix
*default compress
netbsd All available NetBSD collections
netbsd-basesrc The base distribution
netbsd-cryptosrc-us Crypto sources
netbsd-doc Documentation
netbsd-htdocs WWW pages
netbsd-othersrc Other Sources
netbsd-gnusrc GNU Sources
netbsd-pkgsrc Packages
netbsd-sharesrc The /usr/share distribution
netbsd-syssrc The kernel distribution
netbsd-xsrc The X11 distribution
csup -g -L 2 <supfile>
OpenBSD
Using CVS:
cd /usr
export CVSROOT=anoncvs@anoncvs.example.org:/cvs
cvs -d$CVSROOT checkout -rOPENBSD_4_3 -P src
cd /usr/src
export CVSROOT=anoncvs@anoncvs.example.org:/cvs
cvs -d$CVSROOT up -rOPENBSD_4_3 -Pd
Using csup:
# Defaults that apply to all the collections
*default release=cvs
*default delete use-rel-suffix
*default umask=002
*default host=cvsup.uk.openbsd.org
*default base=/cvs
*default prefix=/cvs
# If your network link is a T1 or faster, comment out the following line.
*default compress
OpenBSD-all
#OpenBSD-src
#OpenBSD-www
#OpenBSD-ports
#OpenBSD-x11
#OpenBSD-xf4
#OpenBSD-xenocara
csup -g -L 2 <supfile>
Build and Install Kernel & Userland
FreeBSD
cd /usr/src
make buildworld
make buildkernel KERNCONF=GENERIC
make installkernel KERNCONF=GENERIC
shutdown -r now (boot -s)
cd /usr/src
mergemaster -p
make installworld
mergemaster
NetBSD
mkdir /usr/obj /usr/tools
cd /usr/src
./build.sh -O /usr/obj -T /usr/tools -U -u tools
./build.sh -O ../obj -T ../tools kernel=<KERNEL>
./build.sh -O ../obj -T ../tools -U distribution
su
mv /netbsd /netbsd.old
mv /usr/src/sys/arch/i386/compile/GENERIC/netbsd /netbsd
shutdown -r now
cd /usr/src
su
./build.sh -O ../obj -T ../tools -U install=/
etcupdate
OpenBSD
cd /usr/src/sys/arch/i386/conf
config GENERIC
cd ../compile/GENERIC
make clean && make depend && make
make install
reboot
rm -rf /usr/obj/*
cd /usr/src
make obj
cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
cd /usr/src
make build
Updating software collection (ports tree, pkgsrc)
FreeBSD
Using portsnap:
portsnap fetch
portsnap extract # Only needed the first time you get the ports tree
portsnap update
Using csup:
csup -L 2 ports-supfile # See: /usr/share/examples/cvsup/ports-supfile
make fetchindex or make index # portsdb -F or portsdb -Uu respectively if using portupgrade
NetBSD
Use csup supfile with netbsd-pkgsrc
csup -g -L 2 <supfile>
OpenBSD
Use csup supfile with OpenBSD-ports
csup -g -L 2 <supfile>
Installing binary packages
FreeBSD
export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/.
pkg_add –rv bash2
OpenBSD
export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.3/packages/i386/
pkg_add -v gimp
NetBSD
export PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/4.0/All"
pkg_add –v kde-3.5.7
Installing source packages
All *BSDs
cd /usr/ports/security/sudo
make install clean
FreeBSD
portinstall port # sysutils/portupgrade
Listing installed packages
pkg_info # -v switch for verbosity
Deleting installed packages
pkg_delete
make uninstall
make deinstall
Listing outdated software
FreeBSD
pkg_version –v
portversion -l '<' # sysutils/portupgrade
portmaster -L # sysutils/portmaster
NetBSD
lintpkgsrc –i # pkgtools/lintpkgsrc
pkg_chk –uq # pkgtools/ pkg_chk
OpenBSD
cd /usr/ports/infrastructure/build/
./out-of-date
Updating using binary packages
FreeBSD
portupgrade -PP gnome2
OpenBSD
pkg_add -ui pkgname
NetBSD
pkg_add –uu # -uu attempt to update prerequisite packages also
pkg_chk -b -P ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD-4.0/i386/All -u
pkg_chk –g # Generate a list of all installed packages. Default: ${PKGSRCDIR}/pkgchk.conf
pkg_chk –r # Remove outdated packages
pkg_chk –abk # Update all using packages
pkgmanager
Updating using source packages
FreeBSD
portupgrade -R firefox # ports-mgmt/portupgrade
portmanager x11/gnome2 # ports-mgmt/portmanager
portmaster –a # ports-mgmt/portmaster
OpenBSD
make update
NetBSD
make update
make replace
pkg_rolling-replace
pkg_chk –ask
Various cleaning in ports/pkgsrc directory
FreeBSD
make clear # Remove the expanded source code
make distclean # Remove the port's distfiles and perform the clean target
portsclean -C # Clean all work directories in ports tree
portsclean -D # Clean old distfiles
portsclean -DD # Clean all distfiles not referenced by any port currently installed
OpenBSD
make clean # Clean work directory
make clean=depends # Clean the working directories of all dependencies of the port
make clean=dist # Remove the source distribution set(s) of the port
NetBSD
make clean
make clean-depends # The same as: make clean CLEANDEPENDS=1
Listing softvare with security vulnarabilities
FreeBSD
portaudit –Fda
NetBSD
audit-packages # Retired in favour of pkg_install>=20070714 (2008-01-13)
Originally posted at: http://www.bsd-srbija.org/dokumentacija/doku.php/bsd_lista_referentnih_komandi