StartUp
I wrote this article for a friend of mine, because she wanted to try out FreeBSD, but didn't want to read through the huge freebsd handbook, which I would recommend. Therefore I wrote down some hints and tricks how to get started!
1.Installing programs:
You have two choices to install programs: One way is to use binary packages, the second way would be using the ports system to install from source.
1.1 Binary package:
This is the fastest way to install a programm, if (!) a binary package exists. During the installation you have chosen a ftp download site. You can just use the command pkg_add -r PROGRAM_NAME
If you have already downloaded the package just leave out the -r option! Beware that PACKAGE_NAME must be equal to the binary package name until .tgz, so you should browse the mirror to find out the name of the package!
1.2 /usr/ports
You can use the ports system to build your programs, which is especially useful if you want to have some special options compiled into the program. The usage is pretty simple. Just cd to /usr/ports and you can search the ports tree by
make search key="YOUR_SEARCH"
After you have found your desired program change into the directory (for example: cd shells/zsh). Then do a:
make install clean
Now it will download all the sources for the programm, including it's dependencies and compile them. Depending on the program this can take a couple of hours or just a few minutes!
You can even edit the configuration files so that your special wishes are compiled into the program (e.g.:KDE with cups support).
All the programs which you install and don't belong to the base install, are located in /usr/local/ ! Even the configuration files for these programms are placed in /usr/local/etc.
2. Some post install configuration:
Directly after the installation I recommend to install your favorite shell. After that you need to tell BSD that you want to use this shell right after your next login. Use the command chsh and edit the line "shell:" to point to your favorite shell. For example:
shell:/usr/local/bin/zsh
If you are not familiar with vi (the standard editor for chsh and a couple of other programs), just change the environment variable EDITOR to your preferred editor by:
export EDITOR=PATH_TO_YOUR_EDITOR
Next I recommend to put your user into the wheel group so that you can su to root. Log in as root and edit the /etc/group that your user name is in the line
wheel:YOUR_USERNAME
3. Startup scripts:
FreeBSD uses the SystemV startup system, which means that what shall be started at startup is defined in /etc/rc.conf in the form:
SCRIPT_enable="YES"
where SCRIPT is a script from either /etc/rc.d/ or /usr/local/etc/rc.d ! You can start/stop/restart all "daemons" by
/etc/rc.d/SCRIPT start/restart/stop
or for programs not included in base
/etc/rc.d/SCRIPT start/restart/stop
4. Disk devices:
Under FreeBSD the first IDE disk, which means it is installed on the first IDE port as a master, is the device /dev/ad0 (for the second one /dev/ad1 etc.). The first partition on the first IDE drive is resembled by /dev/ad0s1 (/dev/ad0s1 for the second partition).
But your disk is even more splitted: During the installation you have created slices resulting in one or more partition(s) for /usr /tmp etc. To access the first slice use /dev/ad0s1a (/dev/ad0s1b for the next one ...).
If you have SCSI devices in your system, the devices for the first harddrive is called /dev/da0
5. Staying up-to-date: Ports tree
This way is just one out of many ways how to update your ports tree!
Unfortunately, there is no good way to get a binary update of your installed program. This time you need to compile everything yourself. We need two tools out of the ports system
sysutils/portsnap
sysutils/portmanager
Now get the new ports tree with
portsnap fetch extract
If you want to be sure not to use insecure programs, install portaudit and get the database with
portaudit -F
so it will not be possible to install programs with known security issues from the ports!
Before starting the upgrade let's take a look at what will be updated with
pkg_version -v
And now take a look into /usr/ports/UPDATING if there is something to consider for one of your updates.
If you are sure you want to continue and update the ports, do:
portmanager -u
If everything compiles, you will have up-to-date programs.
To upgrade the base system (including kernel), please follow the instructions from the FreeBSD handbook:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
