Port Version Conflict Question

Quick questions for anyone out there.

I ran into a problem when trying to install git. It seems that when I use pkg_add -r git, a messages shows a conflict in perl versions and doesn't install. However, I was able to install it via its port without the same problem. Is pkg_add not the same as using the port tree?

Thanks in advance.
 
When you install from ports, it is effectively building the software from source.

Because of this it causes it to link and match against the versions of software you already have installed.

Binary packages as you have found out require 100% matching versions of software as their dependencies because often their dependent library names are hardcoded into the binaries etc...

Because of this, mixing ports and packages can often cause problems if the ports tree is newer (or older) than the packages location you are installing from.

You can mix and match ports and packages by simply creating packages from your ports tree snapshot, and then the resulting packages are guarenteed to work perfectly with each other and other installed ports.
 
Thank you for responding so quickly. I have some more questions if you don't mind but please don't feel obligated to respond to them.

I understood this part:
When you install from ports, it is effectively building the software from source.

Because of this it causes it to link and match against the versions of software you already have installed.

Binary packages as you have found out require 100% matching versions of software as their dependencies because often their dependent library names are hardcoded into the binaries etc...

However the next section scares me a little as I have recently mixed and match.

Because of this, mixing ports and packages can often cause problems if the ports tree is newer (or older) than the packages location you are installing from.

For example, I'm following a recent wiki post for installing freeswitch. It describes in a section to install autoconf262 using pkg_add -r. When I attempted this, it could not obtain the url. I then went on to using the port for the install but ended up with autoconf28x. I then continued following the wiki and install gcc34 using pkg_add. Should I have installed all the dependencies from the port tree and install freeswitch via source since the port is for testing only?

You lost me a little on this one...
You can mix and match ports and packages by simply creating packages from your ports tree snapshot, and then the resulting packages are guarenteed to work perfectly with each other and other installed ports.

I found what seems to be a good article that describes how easy it is but I still don't see how this prevents dependency issues.

http://www.rhyous.com/2010/11/12/making-a-package-from-a-port-on-freebsd/

Thanks again for your time.

Fatman
 
Thanks Ikreos!

I had to re-read the thread a couple of times before I understood. So if I read it right, the packages on the ISOs are never updated and the binary versions used by pkg_add are update approximately once a month.
 
Fatman said:
Thanks Ikreos!

I had to re-read the thread a couple of times before I understood. So if I read it right, the packages on the ISOs are never updated and the binary versions used by pkg_add are update approximately once a month.

From what they said on the other thread. Packages for a RELEASE (i.e. the ISOs) are never updated period. Packages for the STABLE branch are updated periodically. So if you are using a RELEASE then you will most likely want to install from ports.

As long as you have the minimum required version of a library or program needed by a port it is okay to mix ports and packages. Lets say you want to compile a port that requires some library vX.Y. That library hasn't been updated in a long time because it's stable and feature complete. It is perfectly fine to install the package for that library, then compile the port that relies on it. However it is much more difficult if not impossible to do the opposite.

In my opinion either use ports or packages, try not to mix them.
 
ikreos said:
From what they said on the other thread. Packages for a RELEASE (i.e. the ISOs) are never updated period.

Yes. A -RELEASE ISO is cast in stone. The idea is that the packages are known to work with that version of the OS.

Packages for the STABLE branch are updated periodically. So if you are using a RELEASE then you will most likely want to install from ports.

You can set PACKAGESITE to fetch the latest packages, regardless of whether you run 8.2-RELEASE or 8-STABLE. These are updated often, maybe not daily but close.

For those who want to use packages but stay updated, ports-mgmt/portmaster and ports-mgmt/portupgrade-devel can both be set to prefer packages to ports when updating. There's also pkg_upgrade(1) from sysutils/bsdadminscripts.

I'm not recommending these package tools, just pointing them out. IME, ports are far less hassle. Unless maybe you have a really slow system.
 
wblock said:
You can set PACKAGESITE to fetch the latest packages, regardless of whether you run 8.2-RELEASE or 8-STABLE. These are updated often, maybe not daily but close.

I contemplated on mentioning that but I wasn't 100% sure.

(Blast! I'm so used to vi I keep wanting to enter commands when I type in a forum:P)
 
Thanks again guys. I thought I'd add to the thread the link to the ports/packages page from the handbook.
http://www.freebsd.org/doc/handbook/ports-overview.html

I had to read this a couple of times before I understood the differences between a port and package as well as how both operate. If there are any other newbs like me reading this, I suggest you check out chapter 4.

Brief Summary From the handbook:
However, FreeBSD provides two technologies which can save you a lot of effort: packages and ports.

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.

A FreeBSD port for an application is a collection of files designed to automate the process of compiling an application from source code.

Remember that there are a number of steps you would normally carry out if you compiled a program yourself (downloading, unpacking, patching, compiling, installing). The files that make up a port contain all the necessary information to allow the system to do this for you. You run a handful of simple commands and the source code for the application is automatically downloaded, extracted, patched, compiled, and installed for you.

In fact, the ports system can also be used to generate packages which can later be manipulated with pkg_add and the other package management commands that will be introduced shortly.

Both packages and ports understand dependencies. Suppose you want to install an application that depends on a specific library being installed. Both the application and the library have been made available as FreeBSD ports and packages. If you use the pkg_add command or the ports system to add the application, both will notice that the library has not been installed, and automatically install the library first.

So after all this reading and helpful advice, i will always try sticking to ports. I quite enjoy using portaudit, portsnap and portmaster to keep my ports updated and secure. If I see a howto with pkg_add, I will instead run a make search or whereis to find the matching port.

Thanks again everyone for all the wonderful advice.

Fatman
 
Back
Top