Reply
 
Thread Tools Display Modes
  #1  
Old 11-06-2007, 05:54 AM
dejamuse dejamuse is offline
Senior Member
 
Join Date: Mar 2006
Location: Orange, CA
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ports tricks
I personally don't care for the PBI concept mostly because it's not updated often enough and the selection obviously pales in comparison to the 30,000+ ports available. I'm also concerned that if I ever update the packages/ports some PBIs may break since some are not entirely self-contained I believe, and depend on installed packages. But PCBSD is still great as it installs and configures a lot of stuff that would take weeks to get right the old way.

Using the port system isn't all that daunting if you know a few tricks.

Here are five great articles that explain how to manage the ports:

Ports Tricks
Portupgrade
Interesting New Ports
Cleaning and Customizing Ports
Browsing Through The Ports Collection
You can find more great articles like this here.

Pity the DesktopBSD tools port is marked 'broken' and won't compile properly as those tools are quite useful for managing packages and ports (used as the basis for PCBSD's competitor, Desktop BSD). Also the various GUI package/port managers like Kports lack the power of most of these tools, especially portupgrade and some are quite buggy.

In addition the following bit of advice is useful. (Be aware though of strange disconnects between what Freshports is saying is current and what is actually on the FreeBSD server - I got bit that way recently trying to install Firefox 2.0.0.9 as a package and ended up with the 3.02 devel version which curiously was marked "ignore" in Freshports.)

Some FreeBSD pkg_add Magic (from Dru Lavigne's BSD Blog)

In a recent comment a reader asked how he could install xorg 7.2 instead of xorg 6.9 on his FreeBSD 6.2 system. Normally pkg_add would do this, but xorg was updated to 7.2 after the release of FreeBSD 6.2, so the default behaviour is to install the version of xorg (6.9) which matches the release of the operating system. The answer is easy, but a bit of background information is useful.
If you go to this section of the FreeBSD ftp site, you'll see that there are several subdirectories containing packages for different branches of the operating system:

* packages-4-stable
* packages-5-stable
* packages-5.5-release
* packages-6-stable
* packages-6.1-release
* packages-6.2-release
* packages-7-current
* packages-current
* packages-stable

Note that there is a difference between packages-6-stable (which contains the latest packages for the 6 branch) and packages-6.2-release (which contains the packages released with that version of the operating system).
You can also see which ftp directory your FreeBSD system is currently using by reading the error received when you try to install a bogus package:
# pkg_add -r abc
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports ... st/abc.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-release/Latest/abc.tbz' by URL
In this case, the system is using packages-6-release/Latest which contains the 6.9 version of xorg instead of packages-6-stable which contains the latest or 7.2 version of xorg. Take a peek in both directories on the ftp site, you'll see for yourself.
You can ask pkg_add to go to a different location by modifying the PACKAGESITE environmental variable by typing this as one line:
setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports ... le/Latest/

Don't forget the trailing slash at the end and make sure you choose a directory meant for your operating system's branch. For example, you don't want current which is the unstable testing version of 7.0 anymore than you want the 4.x version of packages on a 6.x system. Typing that setenv command at the command line will only work for that one session; if you wish to change permanently, add that line to the setenv section of /root/.cshrc .
This trick is also handy if you want to change to a faster, geographically closer mirror or if you have your own repository of packages on another system in your network.
Reply With Quote
  #2  
Old 11-06-2007, 01:33 PM
fredBSD fredBSD is offline
Senior Member
 
Join Date: Oct 2007
Location: Shropshire UK
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Ports tricks
Good stuff dejamuse, thanks.

I think I'll try the desktopbsd-tools package. It'll be interesting to see if it does what I imagine it could.

A couple of points about using ports (the Dru Lavigne portupgrade article is getting on a bit now):

No need to install cvsup any more as 'csup' is already installed on PCBSD. Its usage is the same as cvsup except the -g flag is not needed.

The two 'r' switches (-rR) to portupgrade are hardly ever required and they slow down the process by doing checksums repeatedly.

It can take many hours to upgrade all the installed ports (about 750* on my main PC). I'm happy to accept the default config and do the upgrade unattended (overnight), so I add '--batch' to the command line. Nothing worse than checking the next day and finding the process stopped on a config screen.

I agree with your comments about the pbi concept, having installed a couple which didn't work recently. I think it's good for users who can't, or will not, use the CLI though...

* (750 ports, not 750 hours of course )
Reply With Quote
  #3  
Old 11-07-2007, 12:48 AM
bledhus bledhus is offline
Member
 
Join Date: Jul 2006
Location: Java Island
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to bledhus
Default Re: Ports tricks
I think PC-BSD should have software management for ports and pbis based on GUI in order to user can install, uninstall and reinstall both ports and pbis without conflict.
Reply With Quote
  #4  
Old 11-07-2007, 01:16 AM
graedus graedus is offline
Senior Member
 
Join Date: Jul 2006
Location: .mx
Posts: 606
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Ports tricks
Dru's articles on freebsd management are quite useful, although some are a bit outdated.

The desktopbsd tools are marked broken indeed. I used them a bit, I liked the Software Management tools, although kports is good enough. PCBSD's functionality to update ports and cvsup is better than DesktopBSD's IMHO.

I don't really think its a good idea to suggest to get packages from a different branch. It is ok for an experienced user to fetch a few ones needed from -stable when he's in -release, but right now, 1.4 is -stable, you can fetch most packages up to date. -current is too bleeding edge. Mixing branches is never a good idea.

I agree to your comment about the PBIs not entirely self contained. I suppose they expect the packages installed with the base system to work properly (can be seen from older PBIs not working as fredBSD said).

Nevertheless, I think the main ones that came with the installation, such as OpenOffice, Opera and Firefox, as well as PAMP for basic web needs, can be useful in a fresh install. I guess this subset of PBIs if updated, can be a nice relief to those who mantain a large collection of ports installed besides the base ones.

You fear updating and installing new ports might break PBIs. What I really fear is that compiling custom kernel, portmanager -a or a make buildworld will, no doubt, break the PCBSD hacks, since it won't find what it expects.

Perhaps the PCBSD team should advice more advanced users to what extent they can tweak their installations without breaking the stuff at /PCBSD, such as the automount scripts, the Desktop Configuration Wizard, etc. And I don't mean reading the raw documentation, I for one, don't plan on becoming a developer soon.
Reply With Quote
  #5  
Old 11-08-2007, 07:25 AM
dejamuse dejamuse is offline
Senior Member
 
Join Date: Mar 2006
Location: Orange, CA
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Ports tricks
Yes, points well taken.

I find it's much faster to use -arRP with portupgrade (P means use a package if available). As far as I've read, the -rR is important, otherwise you could end up with ports that refuse to upgrade and that's just a freaking mess. That is after all why portupgrade was invented. I just run an update overnight. If I run into an options screen in the morning, well no big deal - not in that much of a hurry. I haven't tried the batch mode thingy yet, but it sounds better.

There is also a new ports utility suite available though I haven't tried it: sysupdate (Freshports)

Sysupdate homepage. It's a rewrite of the 'update' port and updates the kernel as well as the ports.

I think anyone contemplating a kernel update or tweaking it themselves is considered quite advanced and probably should run their own FreeBSD and KDE, etc. Seems like PCBSD isn't that far behind FreeBSD releases so I don't see much advantage in tweaking the kernel for myself.

I have installed FreeBSD, KDE, AMP, etc, but it's a royal pain getting everything to work properly together - usually takes me a month of playing around to get everything right. And then if you have to redo it for some reason... UGH. I suppose I could burn my own ISO - just don't know how.

Kports is getting stale - the developer is essentially AWOL. It doesn't appear to use any of the portupgrade tools and doesn't use portsnap. It also crashes a lot.

I would like to see PCBSD integrate a fully functional ports/package manager for those who prefer this method to PBI. Let's be frank - PBIs will never offer the sheer volume of, what is it now, 30,000+ ports.

I sure would like to know why desktop-tools is broken. That project seems to be stalled.

BTW, anyone know why Freshports isn't always in sync with the ports database at FreeBSD? I tried to upgrade Firefox to 2.0.0.9 using pkg_add but got Version 3 - devel which isn't even a beta release yet. My PACKAGESITE environment variable was set to 'packages-6-stable/Latest'.

I'd also like to see a comments/forum section integrated with Freshports for the exchange of info and tips.

...Jeff
Reply With Quote
  #6  
Old 11-10-2007, 12:14 AM
Oliver Herold Oliver Herold is offline
Senior Member
 
Join Date: Jul 2006
Location: somewhere in old europe
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Ports tricks
Believe me blindly using portupgrade -a or some mambo jumbo as above is the first step to some disaster. After several years of using FreeBSD I just know one thing for sure, take care in dialing with the ports! Upgrade them port by port, furthermore portupgrade isn't perfect, there are some bugs from time to time. And if you're using some fancy new scripts, you should know what you are doing. Ports aren't made for todays heavy applications with lots of dependencies. It can be okay today, it can be a mess tomorrow.
Reply With Quote
  #7  
Old 11-12-2007, 05:37 AM
dejamuse dejamuse is offline
Senior Member
 
Join Date: Mar 2006
Location: Orange, CA
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Ports tricks
Yeah, that sounds like some pretty sage advice. I haven't had any big problems save for the dozen or so ports that always refuse to upgrade for one reason or another.

But I can certainly see how disaster could unfold when upgrading willy nilly. As you say, better to upgrade ports one at a time and only if it makes sense, i.e. an important security update as opposed to some new feature you don't really need. In any event it's imperative to read the release notes for a new version of a program to judge the importance of an upgrade and to discern any possibility of a conflict or problem.

Here are a couple of other good articles on upgrading ports:

Strategy for Upgrading

Top ten rules for using ports system

Upgrading can't be avoided completely either since eventually you'll want to install some new port that won't work with an old dependency. Probably one of the most complicated upgrades would be for KDE since it depends on so many other ports. Before upgrading anything make sure you have a copy of the old package in case you have to go back.

You can also do a pkg_version -aR to see which packages require others. Then upgrade from the bottom up since if a dependency won't compile or otherwise not work, then other software that depends on it won't work either.

There is no perfect push-button tool - you have to use judgment when upgrading, and try to avoid the often compelling urge to have the latest and greatest for the very sake of it.
Reply With Quote
  #8  
Old 11-13-2007, 12:07 AM
Oliver Herold Oliver Herold is offline
Senior Member
 
Join Date: Jul 2006
Location: somewhere in old europe
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Ports tricks
I'm using portmaster nowadays, because I do not use KDE/Gnome as desktop my problems are rather small. I'm using Fluxbox since one or two years, almost ten years I did use fvwm only ;-)

>Probably one of the most complicated upgrades would be for KDE

It's compared to Gnome one of the 'easiest' so far, it's more mature. Therefore every desktop flavour of FreeBSD is using at as desktop. Gnome is sometimes PITA especially if you're building some desktop flavour.
Reply With Quote
  #9  
Old 11-13-2007, 05:53 AM
graedus graedus is offline
Senior Member
 
Join Date: Jul 2006
Location: .mx
Posts: 606
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Ports tricks
I concurr with most of the points of the top-10-rules blog, trying to keep every port up to date is a lesson I learned the hard way. Unless you are running a security critical server (which it shouldn't be the case of PCBSD) updating and installing ports as needed is the best strategy.

Many converts from windows (such as me) became used to update frequently in order to patch vulnerabilities, product of bad coding practices. Although security is important, occasional vulnerabilities that emerge on BSDs are not as critical in a desktop casual environment to require being constantly up to date,(in most cases would require a 1-3 days recompiling).

Also, having as base a -stable branch helps a lot when looking to install new software, since a lot of ports are available as packages. I always try to install via portinstall -P, and portinstall -P or portupgrade -fP if any dependency error emerges.
Reply With Quote
  #10  
Old 11-13-2007, 05:45 PM
supercobrajet supercobrajet is offline
Senior Member
 
Join Date: Aug 2007
Posts: 168
Thanks: 12
Thanked 8 Times in 4 Posts
Default Re: Ports tricks
Hi, and thanks for the Good tips and other advice on using the BSD ports system...

portinstall is just portupgrade with the -N (for new also) switch.

I have been using "portsnap" to install a fresh new(latest) ports tree and then
"portinstall -rRp", or "-rRP" along with "-batch" to install/upgrade any specific new or existing ports that I need on PC-BSD 1.4

So far it has worked great for me. (probably because PC-BSD 1.4 is a fairly "newer" STABLE version of FreeBSD)

Someone mentioned here that using "-rR" is ok to use
I agree that upgrading recursively up and down will grab all the gotchas' and dependencies that maybe required by other ports -which is a good thing NO?

-and yes, eventually I will hit ports where it tells to upgrade kdelibs,.... but a couple hours later evrything is done and all is ok, but again, -for my needs. its a lot faster then waiting days on end for a complete ports upgrade ?

-I honestly don't know if the above is "wrong" to do, with ports its "murphy's law" and it took me a long time to realize (like others) that portupgrade is not "Windows Update" , and ports, just like apt-get, or emerge for gentoo does require a certain feel of use.

cheers.
Rick.
__________________
"the BSD things in life are Free"
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please no support questions here - Only tips and tricks Charles Tips and Tricks 0 08-11-2007 10:50 PM
Fastest CVSup Tips & Tricks dracheflieger Tips and Tricks 7 07-19-2006 05:16 AM
adding ports with cvsup/root/ports-supfile(solved) catlett Startup Bug Reports (read-only) 6 06-04-2006 11:30 AM
do you want your system to fly? (tips&tricks) antik Tips and Tricks 25 05-14-2006 09:22 PM
KDE tips&tricks antik The Lounge 1 05-04-2006 09:40 PM


All times are GMT. The time now is 11:18 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.