PC-BSD Quick Guide

This is the draft I sent in for the PC-BSD Quick Guides 4th chapter, I’ve replaced my HTML Comments with C Style /* Comments */

Common tasks

In this chapter we will go over a number of common tasks faced by every day users and administrators. We will discuss such matters using plain English and describe it using graphical user interfaces and the command line interfaces as well as configuration files. This will allow you to chose which method you prefer and to be more productive.

We have broken down common tasks into the following:

  • Installing applications
  • Adding new users
  • Adding custom fonts
  • Downloading system updates

Installing Applications

There are several methods of installing software on a PC-BSD system. Each method will be discribed in more detail below.

  • PBI Installer, the easy way
  • Packages, the quick FreeBSD way
  • Ports, the traditional FreeBSD way

When you install software from a PBI you will be presented with a simple graphical way to install software. Simular to many other popular operating systems you just click and go. Since PBI programs are created from traditional FreeBSD ports and packages they are fewer and less up to date then ports.

Ports and Packages are the traditional ways of installing software. You can get the most up to date software by compiling from ports. You may also quickly install allot software using packages, but not all software is available as a package or PBI.

Installing software via PBI

When you install a program through the PcBsdInstaller system it is placed with all required files in it’s own folder in /Programs and linked into the system. This is very simple and safe to the persons system as person is not changed more then necessary to allow the packages to function.

/* Update the URL if it ever changes */

To install a PBI we need to go to the PBI Directory and download a program

/* Stick screen shot(s) of PBIDir here */

Once the download is completed simply double click on the file to launch the installer. It will prompt you once for the super users password before beginning the installation process. This is to ensure you are installing the program and not any one that may have sat down at your computer. It’s both effective as a security measure and parental control.

Click next at the welcome screen, you will then be asked to read any license agreements that comes with the program you are installing. Check the I agree box and click next to continue installation. You may have the options of placing icons on your desktop and entries in the PBI Programs section of the K-Menu. Check all boxes that apply to what you wish done and click install. Once it has completed the installation click finished and tryout your program

If at a later date you wish to add an icon to your desktop for some thing you did do during a PBI install, or when using ports/packages you may do so by right clicking on the desktop and selecting “Create new link to application”. This will open a menu where you can set thename of the icon, it’s picture (click the cog image), click the Application tab. Here you will have to set the program you wish to create an icon for, you can also set a comment, disrisption, work path, and file types as you feel necessary. You can also install in text mode from a console by changing directory to the location of the PBI and run the following as the super user.

./PBI_File -text

Fetching packages

Packages are prepared files for installing software, they install software into the system and can cause dependancy issues. The package system is comparable to RPM, Dpkg, and Apt-Get used in several Linux Distros. Installing packages requires you to open a console with root permissions. You can type kdesu konsole in a run dialog from the K-Menu or open a konsole from the K-Menu in super user mode, or open a konsole and type su and press enter. You will be prompted for the root (super user) password, it will nto display the password on screen for security reasons. After switching to the super user account you have complete access to the system and can install software at will.

You can install a program using the package system like so:

#pkg_add -r irssi

will install the irssi program with all required files but not update the K-Menu or desktop. You can generally find the binary (executable) in /usr/local/bin, configuration files in /usr/local/share// or your home directory and the libraries (like .dll) will be placed into the system as needed and shared between applications. This is true for ports as well, the PBI system is favored by users wanting to avoid this at the minor expense of some disk space. As PBI install all files into /Programs/ but ports are kept up to date and contain many more programs.
/* Special thanks to adamant1988 on #pcbsd for coming up with the package. I don’t think a CLI IRC client is right for this but I needed a quick program thats not a PBI yet */

You can uninstall a package by using the pkg_delete command and the name and version of the package or a wild card.

pkg_delete irssi-0.8.10_2 and pkg_delete “irssi-*” are equavilent.

You can get info about an installed package the same way using the pkg_info command.

#pkg_info “irssi-*”

Installing software using ports

Traditionally BSD installs software from source, the ports collection is a easy to use system that makes this as painless as possible. You first need to install an up to date ports collection before you may use ports to install software. New users coming from Gentoo GNU/Linux will find this similar to the Emerge system which is based on FreeBSD ports.

To install the ports collection click on the K-Menu and navigate to settings, administration, PC-BSD System. Enter the super users password to access the admin panel and click on the tasks tab. Now click fetch ports and it will begin downloading the necessary files and installing them.
This will take awhile depending on your Internet connection and Processor speed.

/* picture of the tasks tab here */
/* Probably delete this part for the quick guide */

If you wish to do this from the command line open a console as the super user as described in fetching packages and run the following command

#cvsup -g -L 1 /root/ports-supfile

You can also use the portsnap method

#portsnap fetch && portsnap extract

If you install ports using portsnap you should not update the ports collection with cvsup, instead use:

#portsnap fetch && portsnap update

if you installed ports using cvsup you may update them in the same way as before:

#cvsup -g -L 1 /root/ports-supfile

You can edit the supfiles and set a download mirror closer to you, please see the FreeBSD handbook for more information on using CVSUP

Now that the ports collection is installed if you look in /usr/ports you will see a simple tree structure of folders. The structure is in the format of catagory, program name.


Adding new users

The two best ways to add a new user to your system is by using the User Manager program or the adduser script. User manager is a graphical program and easy to use with the mouse. Adduser is a very flexible command line method.

Open the K-Menu and go to settings, Security & Privacy, User Manager. Here you can add, remove, and lock users, change the super users (system) password). To add a new user you will need to have a user name and password, you may also input the full name of the user for reference.

/* Insert screen shot of user manager */

To add a new user with adduser open a konsole in super user mode and run:

adduser

Here is an example of running the adduser script, the options listed in side brackets are the default used when merely pressing enter to continue.

Dixie# adduser
Username: joe
Full name: Joe User
Uid (Leave empty for default):
Login group [joe]: wheel
Login group is wheel. Invite joe into other groups? []: operator
Login class [default]:
Shell (sh csh tcsh bash nologin) [sh]: bash
Home directory [/home/joe]:
Use password-based authentication? [yes]: yes
Use an empty password? (yes/no) [no]: no
Use a random password? (yes/no) [no]: no
Enter password:
Enter password again:
Lock out the account after creation? [no]: no
Username : joe
Password : *****
Full Name : Joe User
Uid : 1002
Class :
Groups : wheel operator
Home : /home/joe
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no):

Here we have added a new user named joe to the groups wheel and operator giving him greator access to hardware and the ability to switch user to root, that is run programs as the super user. The choice of shells include the bourne SHell, C Shell and the Bourne Again SHell. More shells can be installed using PBI, Ports, or Packages. You should only add users to the wheel or operator groups that you want to have administrator access to the machine. An example of this would be some one you would give the super user password too, is someone who should be in the wheel group. Some one who you do not want to have the ability to switch to the super user should not be in the wheel group!

. An example of this is a child you may not want to be able to modify important files should not be in the wheel group. While a spouse you wish to be able to install software should be.


Adding Custom Fonts

To install additional fonts that you have downloaded from the Internet. Open the K-Menu and go to Settings, System Administration and click Font Installer. You can install personal fonts for use with your account or you can install fonts to be used system wide. Only the super user can install system wide fonts.

/* Screen shot of font installer, admin mode */

To install a new font click add font and locate the .ttf font file you wish to add. If you click administrator mode you will be prompted for the super user or “root” password. Then you will be able to view and add system wide fonts in the same was as personal fonts. The font installer program only shows you fonts installed for yourself when not in administrator mode.


Downloading System Updates

Updating a PC-BSD system is a very simple process unlike many GNU/Linux distributions, PC-BSD is updated in a similar matter to installing software using PBI. You can check if your system is up to date by running the Online update utility.

Open the K-Menu and browse to Settings, System Administration and click Online Update. It will prompt you for the super users password before allowing you to alter the system. You will have the option of setting the system to check for updates at a specified time daily or weekly, default is not to check. However the system will always check for updates at startup and you can manually check here by clicking “Check now”. After editing any settings here be sure to click the “Save” button to save your changes. You will then be able to select, fetch, and install any updates it finds.

/* Screen shot of Online Update */

To manually download an update go to www.pcbsd.org and find the download system updates section (under the downloads menu on top of the site. As of this writing you can obtain updates from here. Download the patch for your version, such as PC-BSD 1.11a to 1.2. Once the download has finished double click on the PBI file to begin the installation, it works just like installing a PBI but simpular.

DO NOT cancel the update while a patch is running, restart the computer or other wise disrupt the update even if it appears to be stalled, an update can take time to complete. You will be notified when the update has been completed and be asked to reboot for all changes to take effect.