You are here: DesktopBSD Wiki Portal » doc » Ports and Packages
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:
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.
We will start this introduction to the DesktopBSD package manager by double left-clicking on the “Software” icon on the default desktop.
Enter your administrator or “root” password at the prompt.
The introduction to the Package Manager. Click on the image for a larger version.
The introduction to the Package List
The Portsnap first-time run dialog. Click on “Yes” to start.
The program “Portsnap” fetches an updated list of packages from the DesktopBSD server.
Portsnap download is now complete.
It is recommended that you have the system do a security check for potential problems with the installed programs.
After reviewing the security list, click “Close”.
This brings up the main package manager screen.
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.
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:
su pkgdb -uF
And exit.
This will correct any inconsistencies or conflicts in the software package database.
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”.
The default method of fetching packages is Portsnap, which uses HTTP protocol and is considered more secure and faster than CVSup.
*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.
Clicking on the security tab will generate an updated list of known or suspected security problems in the entire FreeBSD ports system.
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”.
This scans the programs installed on your system and recommends upgrading or deinstalling problem items.
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.
In the bottom left corner, we see that the package “x11-fonts/xfs” has a more recent package that we can upgrade to.
In the bottom right corner, click on “Upgrade”
This prompts us to read the upgrade notes for any possible issues involved in the upgrade process. Click “Yes”.
Enter “xfs” in the search box and hit “Enter”. This will open the file ”/usr/ports/Updating”.
In this case, there are no problems expected in the upgrade.
We are now prompted to start the upgrade. Click “Yes”.
The upgrade manager starts, and tells us it has successfully found and downloaded the package from the repository.
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.
To install a new package, for example a simple game called “agame”, first click the icon to the left of “Install software”
Then browse down to the “games” section of the package list.
Select “agame”. You can also type in the name of the package at the top of the pane.
Click on “Install” at the bottom right of the main pane and “agame” will appear at the top of the right-hand pane.
Click on “Start” at the bottom of the right-hand pane.
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.
The program installation is now completed.
KDE now prompts us to add this program to the menu.
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 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.
As an example, let us look at the directory /usr/ports/www. These are programs for the World Wide Web such as browsers.
We will look for the “Firefox” directory.
In this directory are all the files required to fetch the source code and build the web browser “Firefox”.
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.
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.
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.
Next we see the file “pkg-message”. This is a security update file that tells us of any current issues with the application.
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