How to install the latest version of software in FreeBSD?

The ports repository (svnweb.freebsd.org/ports/head/) shows haproxy is version 1.7.10 but pkg search haproxy gives me

haproxy-1.7.9 Reliable, high performance TCP/HTTP load balancer

It suggests that pkg search uses other source instead of FreeBSD ports. Is that true?

How can I install the latest version of haproxy-1.7.10 in FreeBSD (preferably using a binary package)?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

I guess that you’re installing packages from the quarterly branch.

The quarterly branch does not always have the latest software, which is why it is regarded more stable than the latest branch. The newest one is 2018Q1 currently and as you can see here the newest haproxy is not there yet.

You may switch to the latest branch as described in the PKG Repository Changed to Quarterly in 10.2?” thread on FreeBSD Forums.

Put the following code into /usr/local/etc/pkg/repos/FreeBSD.conf:

FreeBSD: {
    url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}

It is generally recommended to store your installed software configuration files under /usr/local. This way it is easier to separate those settings from the configuration files of software shipped with FreeBSD. pkg(8) is somewhat special. Although being an essential utility it is not installed by default (it has to be bootstraped using pkg(7)). This is why its configuration files fit both /etc and /usr/local/etc.


See also:

Solution 2

Check what package repository are you using:

cat /etc/pkg/FreeBSD.conf

Make sure you have url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" in there, not quarterly.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply