HOWTO: Install PC-BSD PBIs on FreeBSD

Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated.

HOWTO: Install PC-BSD PBIs on FreeBSD

Postby nickednamed » 16 Oct 2012, 20:00

This "HOWTO" hopes to explain and demonstrate how to make basic use of PC-BSD's [port]ports-mgmt/pbi-manager[/port] to install, update and delete PC-BSD PBI style packages on FreeBSD. I may update this later to include changing the default repository and creating your own PBI files, if I ever do that myself.

Contents

1. Introduction
- a. What is a PBI?
- b. Why would I want to use PBIs?
- c. What is ports-mgmt/pbi-manager?
2. Installation
- a. From ports or packages
- b. Setup and configuration
3. How to use [port]ports-mgmt/pbi-manager[/port]
- a. Find / check a repository
- b. Find an application to install
- c. Install your chosen application
- d. Upgrade application(s)
- e. Remove application(s)

1. Introduction

A. What is a PBI?
A PBI is an application packaging format first implemented on PC-BSD as part of its package management system, both of which are now available on FreeBSD via the [port]ports-mgmt/pbi-manager[/port] application.

B. Why would I want to use PBIs instead of regular FreeBSD ports/packages?

Of course, to really learn FreeBSD I wholeheartedly recommend the ports system both for the knowledge and skills it provides and also for fine-grain control over your applications. However, I think that PBIs do in fact serve a very useful purpose on FreeBSD.

PBIs are self-contained application packages containing all the files and libraries needed to run that application. The purpose of this is to separate the base system from the applications it runs as much as possible in order to protect the system from such problems as: broken ports and packages; broken, missing and/or incompatible libraries; botched un/installations; tricky updates and so-called "dependency hell".

I personally use it for testing and running large, rarely needed, complicated graphical applications which require a large number of dependencies, toolkits and libraries, such as [port]editors/libreoffice[/port] and [port]deskutils/calibre[/port]. In this way, I can avoid lengthy, complicated and problematic install/update/deletion procedures and keep my base system as clean and unchanged as possible.


C. What is [port]ports-mgmt/pbi-manager[/port]?
PBI Manager is a suite of command line utilities which can be used to find, install, remove, create, update and generally manage PBIs and their repositories. PBI manager features the following tools (but not only) which I hope to explain in this HowTo: pbid, pbi_add, pbi_browser, pbi_delete, pbi_info, pbi_update. For a full list see PC-BSD PBI Manager page


2. Installation

A. Install [port]ports-mgmt/pbi-manager[/port] via the ports system:
[cmd=#]cd /usr/ports/ports-mgmt/pbi-manager[/cmd]
[cmd=#]make install clean[/cmd]

Or install via packages:
[cmd=#]pkg_add -r pbi-manager[/cmd]


B. Configuration
In order to use [port]ports-mgmt/pbi-manger[/port] you should have the PBI daemon running:
[cmd=#]/usr/local/etc/rc.d/pbid start[/cmd]

To have the PBI daemon run on system startup add the PBI daemon to [file]/etc/rc.conf[/file]:
[cmd=#]echo 'pbid_enable="YES"' >> /etc/rc.conf[/cmd]

If the pbid daemon is running, the repository's index and meta files will be automatically fetched and made ready for browsing.


3. How to use [port]ports-mgmt/pbi-manager[/port]

A. Find / check the official PC-BSD repository using [file]pbi_listrepo[/file]:
[cmd=#]pbi_listrepo[/cmd] This should give you:
Code: Select all
[ID]  [Description]
-----------------------------------------------------
001 Official PC-BSD Repository



B. Find an application to install by name using [file]pbi_browser[/file]:
[cmd=#]pbi_browser -s APPLICATION_NAME[/cmd].

For example [cmd=#]pbi_browser -s libreoffice[/cmd] gives the output:
Code: Select all
Using RepoID: 001
Searching for: libreoffice
------------------------------------
Application: LibreOffice
Version: 3.5.6
Created: 20120907 220121
RootInstall: NO
Arch: i386
Author: The Document Foundation
URL: http://www.libreoffice.org/
License: GPL
Type: Graphical
Keywords: Office,Word,Excel,SpreadSheet,Access,PowerPoint
Icon: /var/db/pbi/repo-icons/dd3920955c2fcf9bcc66b20dc0d89354-LibreOffice.png
Description: LibreOffice is the free power-packed Open Source personal productivity suite
for Windows, Macintosh and Linux, that gives you six feature-rich applications for all
your document production and data processing needs: Writer, Calc, Impress, Draw, Math and Base.

To install this PBI:
# pbi_add --rArch i386 --repo 001 -r LibreOffice


Or alternatively use the following options:
[cmd=#]pbi_browser -c CATEGORY[/cmd] to list all applications listed in a specified category.

[cmd=#]pbi_browser --listcats[/cmd] to list all available categories in your chosen repository.

[cmd=#]pbi_browser --viewall[/cmd] to list all PBIs in a given repository.

These options can be rather slow and cumbersome as they produce very many lines of text, however in this case, [file]/usr/bin/grep[/file] is your friend :)


C. Install your chosen PBI using [pbi_add[/file]:
[cmd=#]pbi_add -r PACKAGE_NAME[/cmd]

Your systems architecture should be chosen automatically, and the PBI daemon should cycle through your listed repositories until the application you have specified is found. You could however, specify the architecture and the repository to be used with the --rArch and --repo options respectively:
[cmd=#]pbi_add --rArch i386 --repo 001 -r LibreOffice[/cmd]


D. Upgrade PBIs using [file]pbi_update[/file]:
Check a specified PBI for updates: [cmd=#]pbi_update -c PBI_NAME[/cmd]

Check all PBIs for updates: [cmd=#]pbi_update --check-all[/cmd]

Update a specified PBI: [cmd=#]pbi_update PBI_NAME[/cmd]

Update all PBIs: [cmd=#]pbi_update --update-all[/cmd]

You can also use the --enable-auto and --disable-auto options to enable or disable automatic updates of a specified PBI.


E. Remove a PBI using [file]pbi_delete[/file]:
In order to remove a PBI from your system, the full name and version of the PBI should be given. An easy way to find this is to use [file]pbi_info[/file]:
[cmd=%]pbi_info[/cmd]. This will give you an output like:
Code: Select all
libreoffice-3.5.6-i386

Then you can run the uninstall command:
[cmd=#]pbi_delete libreoffice-3.5.6-i386[/cmd]


References:
PC-BSD PBI Manager page
nickednamed
Member
 
Posts: 122
Joined: 04 Jan 2011, 22:02

Return to Howtos & FAQs (Moderated)

Who is online

Users browsing this forum: No registered users and 0 guests