Alternate OS: PC-BSD, Part 2



by Darrel Johnston (djohnston)

I must confess that I have re-installed PC-BSD since writing the last article. Not once, but twice. Once I began using the system, I ran out of disk space on one partition. The partitioning method I chose did not create a large enough /usr partition. I discovered my error after the KPorts PBI continually refused to install. More on PBIs a little later on.

That’s why I reinstalled the first time. I reinstalled again because the first time around, I installed an XFCE desktop. That should not have been a problem. However, once I installed KPorts, it stubbornly refused to start. I checked error messages after launching it from a terminal, but could find nothing conclusive. Believing that the application might be missing something that is included in the KDE desktop, I reinstalled a second time, choosing PC-BSD’s default KDE desktop. And, this time, I created a 40 GiB virtual disk.

In the Disk setup portion of the installation, I chose to use the entire disk with a UFS filesystem, just as before.

Next, I clicked the Advanced Mode tab and clicked the “Use default layout” button. As a result, the lion’s share of the disk space was given to the /usr partition. 34GiB of the disk’s 40GiB, to be precise.

Just before the Installation phase, this was displayed:

I then installed just as before, but with a KDE desktop selected instead of XFCE. The KDE splash screen is shown below.

And the KDE desktop after applying a few customizations.

The KDE version is 4.7.3.

An update notifier is part of the standard KDE desktop, as well as XFCE. On first run, any updates to existing packages are displayed in a window, with the option to install them all with a single button click.

Once the updates are installed, the update notifier icon in KDE’s system tray will change to a green shield.

Back to the subject of the /usr partition, you may be wondering why it needs to be so large. The short answer is that a lot of files are stored there. Most BSDs come with native Linux support, and PC-BSD is no exception. There is a /home directory, but it’s actually a soft link to /usr/home.

[darrel@pcbsd-2626] ~> ls -l /home

lrwxr-xr-x  1 root  wheel  9 Jan  5 13:00 /home -> /usr/home

[darrel@pcbsd-2626] ~>

In addition to user’s home directories being stored in the /usr directory, many libraries and binary executables are stored there.

[darrel@pcbsd-2626] ~> ls -l /usr/

total 84

lrwxr-xr-x   1 root  wheel            10 Dec 27 19:58 X11R6 -> /usr/local

drwxr-xr-x   2 root  wheel          7680 Apr  9 23:11 bin

drwxr-xr-x   2 root  wheel           512 Dec 27 15:46 games

drwxr-xr-x   3 root  wheel           512 Apr  9 23:11 home

drwxr-xr-x  52 root  wheel          5632 Dec 27 15:48 include

drwxr-xr-x   7 root  wheel         12800 Dec 27 15:48 lib

drwxr-xr-x   4 root  wheel           512 Dec 27 15:46 lib32

drwxr-xr-x   5 root  wheel           512 Dec 27 15:46 libdata

drwxr-xr-x   6 root  wheel          1536 Dec 27 15:48 libexec

drwxr-xr-x  20 root  wheel           512 Apr 10 04:44 local

drwxr-xr-x   2 root  wheel           512 Dec 27 15:46 obj

drwxrwxr-x   7 root  operator        512 Apr 21 19:49 pbi

drwxr-xr-x  67 root  wheel          1536 Apr  9 23:09 ports

drwxr-xr-x   2 root  wheel          5632 Apr  9 23:16 sbin

drwxr-xr-x  27 root  wheel           512 May 18  2010 share

drwxr-xr-x   2 root  wheel           512 Apr 10 04:43 swap

After installing Firefox, htop, mc and KPorts, the /usr directory already occupies 9GiB of disk space.

[darrel@pcbsd-2626] ~> df /usr

Filesystem          1K-blocks        Used        Avail Capacity  Mounted on

/dev/label/usr0  35177228 9343812 23019240        29%        /usr

[darrel@pcbsd-2626] ~>

The 40 GiB disk is already using 16.87 GiB. This is for a KDE 4 desktop and four user installed applications. There are practically no data files in my home directory. And none are of any consequential size.

You may have noticed a /usr/pbi directory. It holds any user-installed PBIs. A PBI, an acronym for PC-BSD installer, or Push Button installer, is a format unique to PC-BSD. It is a self-contained package with all files and libraries necessary for an installed program to function correctly. Any program dependencies are included in the package. Previously, this arrangement could end up with duplicated files all over the system. Beginning with PC-BSD version 9.0, under Dru Lavigne’s stewardship, there are now checks in place to ensure that files are not duplicated when installing PBIs. Previously, users could download PBIs from the pbiDIR site and install them locally. With PC-BSD version 9.0, all PBIs must be installed from PC-BSD’s AppCafe desktop application.

Because PC-BSD is catering primarily to the desktop user, they created the PBI format, along with a simple method of installing these packages. Click the PC-BSD menu button on the KDE panel and select System > AppCafe. The main program window is shown below.

You can select an Application Category by clicking on one, then scroll through all the selections. There are a lot of categories and many, many more program selections. If you already know the name of the program you want to install, simply type it into the search window. Oddly enough, entering mc does not bring up the program. But, entering midnight does.

Click the Midnight Commander icon.

A summary of the program is shown. To install, simply click the Download arrow. You will get a dialog window asking if you want to download and install the program. After answering Yes, download and installation progress will be shown in the Installed tab of the AppCafe window.

The ports tree is the traditional BSD method of installing binary packages. KPorts is a PBI I installed in order to use a GUI to access program ports. The PBI description reads:

KPorts is KDE-Frontend to the FreeBSD-Ports and in future also to the OpenBsd-Ports, PkgSrc and maybe others. You can browse and search through your Portstree and perform actions like Upgrades, Installs, Uninstall a.s.o. More advanced features like setting Options and Vulnerability checking are also available. For a complete list, check the Homepage or the Changelog. Functionality is KPorts\' main goal, not simplification by reducing options however KPorts should be rather easy to use. A new version of KPorts based on completely new code and Qt4 is available @ /usr/ports/ports-mgmt/kports-qt4 NOTE that the new version cannot yet compete with this version feature-wise.

I wanted to include the use of KPorts in this article. Unfortunately, every method I’ve used so far fails to launch the program. Neither kdesu kports nor kdesu dbus-launch kports works. The program window appears on the desktop for about one second, then disappears. I get no clues from the error messages in the console window as to what the problem is. Running the program as user root doesn’t work, either. Entering just kports in the terminal window tells me I need to be root to run it. However, the PBI description states: “Requires Root: NO”

The next and last article on PC-BSD will show how to use the ports tree to install and update programs. If KPorts GUI is still not working by then, I’ll cover using the traditional CLI methods.