![]() |
|
|||||||
| Guides All Guides and HOWTO's. |
![]() |
|
|
Thread Tools | Display Modes |
|
||||
|
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
). 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.FreeBSD Updating source code Using csup: Code:
*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 Code:
csup -g -L 2 <supfile> Code:
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 -i -U -F exit Using portsnap: Code:
portsnap fetch portsnap extract # Only needed the first time you get the ports tree portsnap update Code:
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 Code:
export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/. pkg_add –rv bash2 Code:
cd /usr/ports/security/sudo make install clean Code:
portinstall port # sysutils/portupgrade Code:
pkg_info # -v switch for verbosity Code:
pkg_delete Code:
make uninstall Code:
make deinstall Code:
pkg_version –v Code:
portversion -l '<' # sysutils/portupgrade Code:
portmaster -L # sysutils/portmaster Code:
portupgrade -PP gnome2 Code:
portupgrade -R firefox # ports-mgmt/portupgrade Code:
portmanager x11/gnome2 # ports-mgmt/portmanager Code:
portmaster –a # ports-mgmt/portmaster Code:
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 Code:
portaudit –Fda GBDE For FreeBSD > 6.0 put following in /etc/fstab: Code:
/dev/ad0s1b.bde none swap sw 0 0 Code:
gbde_swap_enable="YES" Geli is awailable from FreeBSD 6.0. Put following in /etc/fstab: Code:
/dev/ad0s1b.eli none swap sw 0 0 Updating source code Using CVS: Code:
cd /usr export CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot co -r netbsd-4 -P src Code:
cd /usr/src cvs update -dP Code:
*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 Code:
csup -g -L 2 <supfile> Code:
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 Use csup supfile with netbsd-pkgsrc Code:
csup -g -L 2 <supfile> Code:
export PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/4.0/All" pkg_add –v kde-3.5.7 Code:
cd /usr/ports/security/sudo make install clean Code:
pkg_info # -v switch for verbosity Code:
pkg_delete Code:
make uninstall Code:
make deinstall Code:
lintpkgsrc –i # pkgtools/lintpkgsrc Code:
pkg_chk –uq # pkgtools/ pkg_chk Code:
pkg_add –uu # -uu attempt to update prerequisite packages also Code:
pkg_chk -b -P ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD-4.0/i386/All -u Code:
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
Code:
pkgmanager Code:
make update Code:
make replace Code:
pkg_rolling-replace Code:
pkg_chk –ask Code:
make clean make clean-depends # Same as: make clean CLEANDEPENDS=1 Code:
audit-packages # Retired in favour of pkg_install>=20070714 (2008-01-13) Code:
cgdconfig -g -V none -o /etc/cgd/wd0b -k randomkey aes-cbc cgdconfig cgd1 /dev/wd0b /etc/cgd/wd0b disklabel -e -I cgd1 Code:
disklabel cgd1 > /etc/cgd/wd0b.disklabel echo 'cgd1 /dev/wd0b /etc/cgd/wd0b' >> /etc/cgd/cgd.conf Code:
echo '/dev/cgd1a none swap sw 0 0' >> /etc/fstab Updating source code Using CVS: Code:
cd /usr export CVSROOT=anoncvs@anoncvs.example.org:/cvs cvs -d$CVSROOT checkout -rOPENBSD_4_3 -P src Code:
cd /usr/src export CVSROOT=anoncvs@anoncvs.example.org:/cvs cvs -d$CVSROOT up -rOPENBSD_4_3 -Pd Code:
# 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 Code:
csup -g -L 2 <supfile> Code:
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 sysmerge Use csup supfile with OpenBSD-ports Code:
csup -g -L 2 <supfile> Code:
export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.3/packages/i386/ pkg_add -v gimp Code:
cd /usr/ports/security/sudo make install clean Code:
pkg_info # -v switch for verbosity Code:
pkg_delete Code:
make uninstall Code:
make deinstall Code:
cd /usr/ports/infrastructure/build/ ./out-of-date Code:
pkg_add -ui pkgname Code:
make update Code:
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 None Swap partition encryption OpenBSD encrypts swap from 3.8 by default. For OpenBSD 3.7 and older: Code:
sysctl vm.swapencrypt.enable=1 Originally posted at: http://www.bsd-srbija.org/dokumentac...entnih_komandi Last edited by s0xxx; 7th May 2009 at 07:48 AM. Reason: Re-aranged by sections, added swap encryption |
|
|||
|
if you know just one port needs updating and do not have the Makefile/distinfo etc
for it, upto date yet, for the most recent csup-able version: cd /usr/ports csup -g -L 2 -i ports/[category]/[portname] /path/supfile-ports (repeat for any new dependencies or dependencies that need updating also)
__________________
using /LOOKAT/ with /var/db/pkg files and portmaster/aliases/pipes/find/grep to meteorically speedup port upgrades/installs... |
|
||||
|
quite interesting, especially for me since I've barely used NetBSD hehe :-)
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||||
|
Thanx, I was about to post it to Guides section, but then I thought it doesn't really look like a guide, more like a reference. I forgot to make a note to moderators to move it where it is more appropriate.
@jb_daefo I was going to put only things found in official docs, there are other "tricks" also, but I don't know if I should mention those too. Thoughts from others? Quote:
Kernel compiling: FreeBSD way - - - OpenBSD way - - - NetBSD way Userland Build: FreeBSD way - - - OpenBSD way - - - NetBSD way Sort of a cross-refrence. But the "section way" is fine too. Quote:
Quote:
Quote:
Quote:
Thanx all.
|
|
|||
|
any body tell me what does the option g stands for in this command
csup -g -L 2 <supfile> iv checked the man page the csup file & nothing there |
|
||||
|
As far as I know it's there for historical reasons, enabling former cvsup users to keep the same command line.
http://slash.dotat.org/cgi-bin/man?name=cvsup Code:
-g Disables the use of the graphical user interface. This op-
tion is implied if the DISPLAY environment variable is not
set.
Code:
case 'g': /* For compatibility. */ break; Last edited by DutchDaemon; 11th November 2008 at 04:55 PM. |
|
||||
|
About FreeBSD's rebuild update this one is safer and faster (-iU)
Code:
# cd /usr/src # make buildworld # make kernel KERNCONF=GENERIC KODIR=/boot/testing # nextboot -k testing # reboot -- If kernel booted and works ok then: Code:
# cd /boot # mv kernel OLD # mv testing kernel Code:
# cd /usr/src # mergemaster -p # make installworld # mergemaster -iU # faster check man mergemaster
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
|
Yes it's right. The KODIR option tells the install process to put the new kernel into /boot/testing instead of /boot/kernel, such that if things fail, you can still boot with the old kernel.
What's missing is the nextboot command, that is used to set which kernel to use on the next boot. You need to use this to tell the boot loader to use /boot/testing/kernel instead of /boot/kernel/kernel. |
|
||||
|
Damn, I knew I forgot something, thanks mate ... corrected.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
|
Quote:
are there any side effects, which could make me consider using /boot/kernel for daily use? |
|
||||
|
You can use nextboot as often as you want. It only lasts for a single boot, though, so you'd have to use it everytime you shutdown. It's meant for testing kernels. If something fails in the boot process, you just reboot, and the system reverts back to using /boot/kernel/
|
|
||||
|
Ok, I re-aranged entries in sections now so it's more readable. I also added swap encryption entries (check the OpenBSD one
) and a sysmerge word to OpenBSD.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn. If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD |
|
||||
|
@s0xxx
I added -i and -U options in FreeBSD section to speed up the merging process: Code:
-mergemaster +mergemaster -iU
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
|
OK.
Than maybe it is worth (and safe?) putting the new '-F' option introduced in 7.2 too? Anyway, I was going to put things mentioned in official docs only, but what a hell...
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn. If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD |
|
||||
|
@s0xxx
IMHO -F seems good choice here, added.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Installing packages from USB drive (OpenBSD 4.5) | divadgnol67 | OpenBSD Packages and Ports | 26 | 30th July 2009 04:21 PM |
| Putting Free/Net/Open - BSDs on one HDD | alpopa | NetBSD Installation and Upgrading | 6 | 23rd December 2008 07:16 PM |
| userland sources | rex | FreeBSD General | 8 | 8th September 2008 12:33 AM |
| How secure is updating and installing online | revzalot | OpenBSD Security | 1 | 4th September 2008 01:42 AM |
| Updating Packages on -current | roundkat | OpenBSD Packages and Ports | 21 | 14th July 2008 11:50 PM |