You are here: DesktopBSD Wiki Portal » doc » Ports and Packages

Translations of this page?:

Table of Contents

Ports and Packages

The DesktopBSD Package Manager

Software in DesktopBSD is called a package, and can be downloaded from a central repository as a ready-to-install “package”, or the package can be built on your computer by compiling the program source code using the “Ports” system.

The DesktopBSD Package Manager is a graphical tool to simplify the installation, upgrading, and removal of software packages ( applications, or programs ) on your system. It also makes it easier to check what packages are installed, and new ones that are available.

Software usually requires other collections of files, or libraries, for the main program to operate. This system uses shared libraries to reduce the number of program files required to run all of the applications installed on your computer. The package manager keeps track of these “dependancies” between packages to ensure that the versions are correct, and that all required packages get installed when required.

* For example:

  1. Package “A” requires library “C” to run on the system.
  2. Package “B” requires library “C” to run on the system also.

The Package Manager will install Packages “A” and “B”, and a single shared library “C”

These functions can also be done from the command line for those users with more experience.

Using the Package Manager

Give a brief overview and some screenshots, impliment text from this page: Installing Software which we might deprecate

Starting the Package Manager

We will start this introduction to the DesktopBSD package manager by double left-clicking on the “Software” icon on the default desktop.

pacman1.jpg

Enter your administrator or “root” password at the prompt.

pacman2.jpg

The introduction to the Package Manager. Click on the image for a larger version.

pacman50.jpg

The introduction to the Package List

pacman51.jpg

Downloading the package list

The Portsnap first-time run dialog. Click on “Yes” to start.

pacman52.jpg

The program “Portsnap” fetches an updated list of packages from the DesktopBSD server.

pacman53.jpg

Portsnap download is now complete.

pacman54.jpg

Security check

It is recommended that you have the system do a security check for potential problems with the installed programs.

pacman55.jpg

After reviewing the security list, click “Close”.

pacman56.jpg

This brings up the main package manager screen.

pacman3.jpg

We will first update the list of packages to find all new versions and security updates as shown. Click on”Update list” at the top left-hand tab.

pacman5.jpg

pkgdb

Before installing, upgrading or removing any ports or packages, it is recommended that you run the following command as the “superuser” (su) at a “Konsole” shell terminal as shown below:

A gentle warning is in order here. When using “superuser” privileges, you have the ability to mess up your system in a spectacular way! Please check your commands carefully before you hit the “Enter” key.
su
pkgdb -uF

konsole.jpg

konsole1.jpg

And exit.

konsole2.jpg

This will correct any inconsistencies or conflicts in the software package database.

Settings

The “Settings” section determines how the manager fetches and installs packages.

pacman10.jpg

Binaries and Source

The default is “Binary packages only”. This will work for most applications. Packages are designed to work well on most systems, and install much faster than compiling source code. Installing from source code will take longer, but will optimize the application for your individual hardware.

Packages may also be a version or more older than compiling from source.

If a package cannot be found by the Package Manager, then use the second entry “Binary packages whenever possible” as shown below.

For example, binary redistribution of patented software such as MP3 encoding is not allowed, so you have to switch to “Binary packages whenever possible”.

pacman11.jpg

Package List

The default method of fetching packages is Portsnap, which uses HTTP protocol and is considered more secure and faster than CVSup.

pacman12.jpg

Notifications

All the notification pop-up functions are selected by default

pacman13.jpg

Advanced

*need more info*

The “Advanced” tab contains settings that can be useful, but require a good understanding about how the package manager functions.

The “Binary package repository” field allows you to specify a different source for downloading software packages for your system. Change only if you are an advanced user, and know the implications.

By default, DesktopBSD will fetch packages from theDesktopBSD build server, which provides more up to date package versions than the FreeBSD site. It is recommended that your packages be built from the same download source to avoid package version conflicts.

The next field is “Always upgrade the packages required by the specified packages as well”. This will automatically upgrade all dependancies of the package currently being installed or upgraded, although this is often not required, and can slow down the upgrade process. It is safe to select this option if you need it.

The next field is “Always upgrade the packages depending on the specified packages as well” As with the field above, it is not necessary, but safe to use if you wish.

The next option is “Force processing of further packages even if prerequisite packages have failed to upgrade” This option can cause the installation of incompatible packages that will produce failure of some programs to run properly. Use extreme caution with this. It is recommended only for advanced users.

The last two fields allow you to specify options that are used when building ports from source only. They will not apply to binary package installation. One of the advantages of using ports is the ability to fine-tune the creation of the software for the existing software and for particular system needs.

pacman14.jpg

Security

Clicking on the security tab will generate an updated list of known or suspected security problems in the entire FreeBSD ports system.

pacman15.jpg

In the bottom left corner, the package manager tells me that the last security check on this system was done 9 days ago. To find any security problems in your installed software, click “Check now”.

pacman16.jpg

This scans the programs installed on your system and recommends upgrading or deinstalling problem items.

pacman17.jpg

In this case, there are two packages that have known problems: “png” and “xfs”. We will highlight and copy the name of the package “xfs” and paste it into a search box for more information.

pacman25.jpg

In the bottom left corner, we see that the package “x11-fonts/xfs” has a more recent package that we can upgrade to.

pacman26.jpg

pacman27.jpg

Starting the upgrade

In the bottom right corner, click on “Upgrade”

pacman28.jpg

This prompts us to read the upgrade notes for any possible issues involved in the upgrade process. Click “Yes”.

pacman29.jpg

Enter “xfs” in the search box and hit “Enter”. This will open the file ”/usr/ports/Updating”.

pacman30.jpg

In this case, there are no problems expected in the upgrade.

pacman31.jpg

We are now prompted to start the upgrade. Click “Yes”.

pacman32.jpg

The upgrade manager starts, and tells us it has successfully found and downloaded the package from the repository.

pacman33.jpg

The installation is complete. Note that there is a warning that one of the dependent packages “xproto” also requires upgrading. We upgraded this package with the default setting, which did not automatically upgrade this dependant package.

By selecting “Always upgrade the packages required by the specified packages as well” in the “Binaries and source” tab, the dependant package would have been upgraded also. This setting is not always necessary, and can slow down upgrades needlessly.

In this case, we will need to also upgrade “xproto” manually.

pacman34.jpg

Installing new packages

To install a new package, for example a simple game called “agame”, first click the icon to the left of “Install software”

pacman40.jpg

Then browse down to the “games” section of the package list.

pacman41.jpg

Select “agame”. You can also type in the name of the package at the top of the pane.

pacman42.jpg

Click on “Install” at the bottom right of the main pane and “agame” will appear at the top of the right-hand pane.

pacman43.jpg

Click on “Start” at the bottom of the right-hand pane.

pacman44.jpg

In this case, the package manager looks for a package, but is unable to find it from the download site.

Because I have selected “Binary packages whenever possible”, the package manager will now install this program by compiling source code instead.

pacman45.jpg

The program installation is now completed.

pacman46.jpg

KDE now prompts us to add this program to the menu.

pacman47.jpg

PORTS and Packages 101

Give a brief overview of PORTS and Packages, link to this page:The Ports System and also link to the FreeBSD Handbook

On DesktopBSD, there are two common ways to add software to your system: ports and packages. These are described on the FreeBSD ports page and the FreeBSD Handbook

Both ports and packages can be installed using the DesktopBSD Package Manager, or you can choose to do the installation manually using a shell command line. See this page for more detailed information The Ports System

From the FreeBSD ports page:

Copyright 1994-2006 The FreeBSD Project. All rights reserved.

“The FreeBSD Ports and Packages Collection offers a simple way for users and administrators to install applications. There are currently 17687 ports available.

Each ``port'' contains any patches necessary to make the original application source code compile and run on FreeBSD. Installing an application is as simple as downloading the port, unpacking it and typing “make” in the port directory. However, the most convenient (and common) method is to download the framework for the entire list of ports by installing the entire ports hierarchy at FreeBSD installation time, and then have thousands of applications right at your fingertips.

Each port's Makefile automatically fetches the application source code, either from a local disk, CD-ROM or via ftp, unpacks it on your system, applies the patches, and compiles. If all went well, a simple “make install” command will install the application and register it with the package system.

For most ports, a precompiled “package” also exists, saving the user the work of having to compile anything at all. Each port contains a link to its corresponding package and you may either simply download that file and then run the “pkg_add” command on it or you can simply grab the link location and hand it straight to pkg_add since it is capable of accepting FTP URLs as well as filenames.

For any given application, the FreeBSD package for that application is a single file which you must download. The package contains pre-compiled copies of all the commands for the application, as well as any configuration files or documentation. A downloaded package file can be manipulated with FreeBSD package management commands, such as “pkg_add”(1), “pkg_delete”(1), “pkg_info”(1), and so on. Installing a new application can be carried out with a single command.”

First we will look at the ports system.

The FreeBSD Ports System

The ports system is a collection of files that allows your computer to compile each program that you wish to install from source code, customized to run most efficiently on your hardware. Because this customizing, or “compiling” is quite complex, it will take longer to do than installing a package. The end result is generally a faster program that is the most up-to-date version available.

When you first install DesktopBSD and open the Package Manager, you will be prompted to create a package list. This will download all of the files required to build the ”/usr/ports” directory on your machine.

ports1.jpg

As an example, let us look at the directory /usr/ports/www. These are programs for the World Wide Web such as browsers.

ports2.jpg

We will look for the “Firefox” directory.

ports4.jpg

In this directory are all the files required to fetch the source code and build the web browser “Firefox”.

ports5.jpg

Let us look at these files that make up the ports system.

The first folder we see is the “Files” folder. This contains various updating patch files for Firefox to allow it to run on DesktopBSD.

ports6.jpg

After that we see the “distinfo” file. This contains the Firefox version number and file size. It also contains two types of file checksum information: the MD5 format, and SHA256 format. These checksums verify that the source code file download has not been changed or corrupted.

ports7.jpg

The next file on the list is the “Makefile” that contains the commands for building Firefox.

After that we see the file “pkg-descr”. This tells us a brief description of what the Firefox application is, and a link to the Firefox developers website.

ports8.jpg

Next we see the file “pkg-message”. This is a security update file that tells us of any current issues with the application.

ports9.jpg

When using the DesktopBSD Package Manager, if you select “Always build from source”, any item you choose to install will always be built from source code only, and will be compiled on your machine in the same way as using the command line

submitted by tippekanu 2007/10/20 03:53