13 March 2007

Get more up-to-date packages

This is a quick tip for saving some compile time and using binary packages instead, where possible.* This assumes that you've updated your ports tree (using cvsup or portsnap) from what it was at installation or the latest upgrade/release. One might choose to not update the ports tree and to just leave your ports tree as it was at installation (or at the last release your system has achieved). I call this the lazy method and it works great (as long as you can be just as happy with version 1.8.10 of some port as you would be with version 1.9.4). But, if you're going lazy, then this tip is not for you and -- in fact -- has the potential to cause inconsistencies which defeat the purpose of the lazy method.

If you do update your ports tree then you might be dismayed that now you have to compile everything. But, you don't. "pkg_add" checks for an environment variable called PACKAGESITE which tells it exactly where to look for new packages -- instead of the default which will look for release packages. Change that and now you can get a more recent version. At present, on FreeBSD version 6.x, this is the value that works for me:


I mention version 6.x specifically because right now the "packages-stable" sub-directory above is a link to "packages-6-stable" on the ftp server. When version 7.x officially becomes the new stable branch, you can expect that link to change. Likewise, the above value wouldn't work for version 4.x (but substitute "packages-4-stable" for "packages-stable" and you'll be in business (yeah, you probably could have gotten that one yourself :) )). So, you may need to update this variable any time you change major versions or the Project moves the "stable" designation to the next major version. Another way to handle this, of course, would be to just use "packages-6-stable" in the URL in the first place -- really, that's the best way, since "packages-stable" will be relinked to a different major version at some point in the future.

While we're at it, this would be a good time to ping some of the ftp mirror sites and find out which one is closest to you. Then you could substitute the hostname in the variable above with something closer and hopefully quicker, say, 'ftp19.freebsd.org' or 'ftp4.au.freebsd.org'. (... Non-working examples. See here for list of valid candidates.)

Probably (hopefully!), you're using portupgrade or another tool to help manage your ports. With portupgrade all you have to do is add the '-P' option to any portupgrade (or portinstall) command and it will recognize the environment variable and check the above ftp address first for the correct version package, before falling back to actually compiling it from the port. ... Or, as all FreeBSD users like to say: everything just works.


I got a good question on this in the comments, one that I'd wondered about myself. I didn't have a good answer so I just gave a crappy one. But, since then I've run across a better answer in the "pkg_fetch" man page. This post is getting long, so I explain here.

* Update 2

This method isn't working right now! If you're on 6.0-6.2, you'd better do all your port upgrades by compiling for now. More here.


02 March 2007

Fun with FreeBSD Advocacy

Help to crack keys (for money!). Found in ports at "misc/dnetc", this program will run at low priority and, if your machine happens to be the one to find the key first, you (or your team) can win $10,000. Not as easy as it sounds, of course. Patience required. :) In the meanwhile, though, your processing power will be making a positive impression for FreeBSD. See here: stats.distributed.net

Stand up and be counted. The mission of the "The *BSDstats Project" is to compile numbers for advocacy and marketing with a specific focus on demonstrating to hardware and software vendors that the BSD's are serious operating systems and need serious support. This is found in ports at "sysutils/bsdstats". It's also one of the smallest ports ever, consisting of a single shell script that is run monthly by "periodic". This port is small and easy and should be run by every *BSD user on every machine possible. See here for the latest count: *BSD Usage Statistics

Sign the "Flash Player for FreeBSD" petition. Everyone should sign this as soon as possible. If you're going to leave a comment with your signature, I recommend something that mentions the benefits to Adobe of officially supporting FreeBSD/*BSD. Lots of comments there are angry and demanding. I certainly understand that attitude! >:-| I'm just not sure if it's the best way to persuade Adobe. And, in the long run, I really do think they hurt themselves by neglecting FreeBSD.

Recommend PC-BSD to your less technical friends. I think it's a lot of fun to build a FreeBSD desktop (or server). But, let's be honest, some people just don't get it. :) PC-BSD is a FreeBSD-based and user friendly operating system. (Note, it's not a fork. It continues to track FreeBSD as its own core.) I haven't used it myself, but there are many positive reviews out there. I think their idea of creating all-inclusive, binary packages (that is, NO dependencies) is brilliant -- and key to success in the non-technical, desktop market. According to both the *BSDstats Project (above) and the page hit count at DistroWatch.com, PC-BSD is already the second most popular BSD! Find out more here.

Seed a FreeBSD torrent. More seeders equals better downloads for everyone and shows an active, helpful community. I used to do this at the official FreeBSD torrent site, which has been disabled. Now, there is another FreeBSD oriented, torrent site called got BSD?

Labels: ,