FreeBSD Ports Tricks
BSD Forums writes "One of FreeBSD's biggest benefits is its ports collection. You can go years without learning more than just make install clean, but there are dozens of features built into the ports tools. OnLamp's Dru Lavigne demonstrates several of these tricks to simplify your life."
It's a good thing that SCO isn't claiming ownership to ALL Unix variants... otherwise they'd have to call it 699DollarsBSD!
And you can even find the Bittorrent client.
my sig
These are pretty useful little tips, thought it looks like almost all of them are in the FreeBSD handbook already.
You just type e.g.:
goat@blindeyes> make emacs --D UNDEAD=1
And your installation of emacs is zombiefied. That means that an emacs process can never crash, is much stronger albeit slower and can only be killed by kill PID -SIGCUTINTOHALFWITHCHAINSAW.
In fact I have a zombiefied apache running here for 742 days without any trouble. Although it eats sometimes other processes.
So all you "*BSD is dead whiners": In fact the death of *BSD is a good thing. It has given the system many new occult powers of which a living system like Linux/MacOS X can only dream. With all these undead processes, vampiric servers and banshee IDS your system is much better than the boring old standard rubbish.
I even heard some rumors from Redmond that MS is working on killing Windows, too. Just for gaining the great powers of an undead system.
Owner of a Mensa membership card.
Maybe not but it sure as hell runs Debian!
-uso.
Dreams, dreams, don't doubt dreams, dreaming children's dreaming dreams. Sailor Moon SS
[to save Slashdot users' bandwidth, a reply about how Gentoo GNU/Linux does most of this stuff, too, and some of it (like making package repositories) in an easier way has been deleted from this space]
The complaint of many people who don't want to switch to BSD from Linux is that there aren't binary packages available and that they don't want to compile everything in ports. This article demonstrates that, indeed, using the ports collection, it is possible to check out and install binary packages using the pkg-* utilities.
There are tons of really neat things about FreeBSD; I won't list them here because they're probably quite off topic. But for anybody interested in learning more; feel free to contact me and/or check out the FreeBSD handbook and the FreeBSD diary.
www.sitetronics.com/wordpress
Reading the article just makes me yearn for a true BSD ports system on OS X.
The closest thing available right now is DarwinPorts but it's horrendously incomplete; I don't think any good package system can get away with lacking any way to track installed packages or perform upgrades; not only is there no facility for system-wide upgrades, but even upgrading an individual package requires an explicit uninstall, download, and reinstall.
I know that the Gentoo, Fink, and OpenDarwin folks are supposed to be collaborating on a unified package system for OS X. Does anyone in the know have any inklings that it might be like BSD ports? A BSD ports system does seem ideal for an OS that is, at the core, BSD.
From http://www.freebsd.org/doc/en_US.ISO8859-1/books/h andbook/linuxemu.html , actually it can in fact run quite a few Linux applications.
"In a nutshell, the compatibility allows FreeBSD users to run about 90% of all Linux applications without modification. This includes applications such as Star Office, the Linux version of Netscape, Adobe Acrobat, RealPlayer 5 and 7, VMWare, Oracle, WordPerfect, Doom, Quake, and more. It is also reported that in some situations, Linux binaries perform better on FreeBSD than they do under Linux." "In a nutshell, the compatibility allows FreeBSD users to run about 90% of all Linux applications without modification. This includes applications such as Star Office, the Linux version of Netscape, Adobe Acrobat, RealPlayer 5 and 7, VMWare, Oracle, WordPerfect, Doom, Quake, and more. It is also reported that in some situations, Linux binaries perform better on FreeBSD than they do under Linux."
"The strong will do what they want, the weak will do what they must."
-Thucydides
The install process asks you: "Do you wish to enable Linux compatibility?"
If you answer yes, it installs a loader that translates a Linux program's system calls into FreeBSD ones. It works rather well.
I've personally run the Linux binaries of Unreal Tournament 2003 on FreeBSD 4.8 with full OpenGL 3D acceleration on my Pentium 3/800 with an NVidia GEForce 3. It ran better than the Windows version does on the same hardware.
Many other 3D accelerated Linux games (like Quake 3) also run just fine under FreeBSD.
My biggest concern about FreeBSD's port collection is that it's essentially "unstable". That is, it seems to be changing on the time. Imagine that you need to setup a web server at one customer's site that requires a set of packages from the ports collection to make the site work. A couple of months later, if you need another server like this, perhaps for a different customer, you might end up with different versions of the tools even though you're running the same version of FreeBSD at both sites. Perhaps, this is a great system for someone who wants to always keep running the latest and greatest but for people who'd like a stable working environment this is an annoyance. Since, I am averse to change, I also like to update only say the packages that have serious bugs or security problems. But with the ports collection, there is no easy way to tell whether a package has been updated because of security issues/bugs or because the port maintainers simply feel like bumping the package version.
It would be a whole lot better if the ports tree was frozen together with the OS when it's released and later only security and bug fixes were merged into the ports (preferably by patching the originally released package instead of just using the latest version, but that would be too much to ask from non-paid volunteers, although Debian does manage to do it).
When I installed FreeBSD for the first time, I noticed that on some configurations the default install is broken. Basically, if you have a small (500MB) /usr partition, you cannot instal ports by default as the standard newfs call used by the installer to create the initial filesystem does not allocate enough inodes.
/usr by hand using the "-i 2048" switch. This one got me the first time round, as it's not mentioned in any of the documentation.
IIRC, you need to format
const int one = 65536; (Silvermoon, Texture.cs)
SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
"[to save Slashdot users' bandwidth, a reply about how Gentoo GNU/Linux does most of this stuff, too, and some of it (like making package repositories) in an easier way has been deleted from this space]"
I know that you're making fun of Gentoo zealots, but in the process, you're in danger of awaking a sleeping giant: The BSD Snob. Because you didn't think before posting, innocent Slashdot readers will be forced to read how the BSDs are better designed, more carefully developed, and are more portable across different platforms. Readers will even be forced to endure accusations that, being Linux users, they wet the bed. Gentoo certainly has its zealots, but BSD users have been looking down their noses at AT&T UNIX since, like, the 1970s. They're the original OS zealots!
See, you've unleashed an Army of Darkness upon us all. Where's Bruce Campbell when you need him?
Steve
Linux and BSD User
why yes, it does
which would you like ?
Red Hat
/usr/ports/emulators/linux_base-6/pkg-descr
/usr/ports/emulators/linux_base-8/pkg-descr
or
DebianThere are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
I've got a NetBSD box running as my external (wild, hairy, unsafe) webserver.
I'd spent quite a bit of time learning Redhat 8, relearned Redhat 9, and again started over with NetBSD. (looking at mandrake, gentoo, and a raft of others as well)
Why is is that these OS's are alike in name only? The package management is entirely different, the disk partitioning is entirely different, heck FINDING files is different ( find * | grep foo vs. find | grep foo)
Enough is slightly different to make it feel like you're learning over from scratch (adduser v. useradd), and enough is COMPLETELY different to prove the point.
One thing I've determined: If I get an applicant who says they know 'Unix' without specifying the flavor will get roundfiled.
"Draco dormiens nunquam titillandus."
There's a great utility in the ports tree called portupgrade. It's very handy and allows for quick and easy upgrading of your ports.
/usr/ports/sysutils/portupgrade
It lives in
Check it out. Start with the manual page (man portupgrade) after you install it, then use Google for more info. It's well worth it.
That page is almost worthless. Don't waste your time reading it, the only tip worth anything is the one about doing a "make readmes". Everything else is better accomplished by using the portupgrade scripts.
Trust me on this one, once you use portupgrade you will not go back to the pkg_* commands.
But Portage is...
Broken?
I killed my Gentoo install when it failed compiling some new ebuild, or just while upgrading, again. And after getting tired of it beeping while compiling Mozilla more often then if someone was typing their thesis in vi in command mode.
Meanwhile everything compiles with FreeBSD on the same computer. So, hey...
Thought I'd save someone some unnecessary building.
"The lesson to be learned is not to take the comments on slashdot too literally." --Vinnie Falco, BearShare
Every FreeBSD admin should know about portupgrade.
It's in ports. It has several tools. One of them, portupgrade, upgrades ports. Another, pkgdb, fixes your ports db by updating out-of-date deps, merging multiple versions of the same port, etc. A third, pkg_version, is like port_version but much faster. A fourth, portsclean, cleans any debris from using ports, such as outdated shared libs.
Get it. Learn it. Love it.
One of my most common uses for this is to look for ports that do certain things not included in their one line description, eg:Just a quick FYI, in case you were unaware of this handy thing.
|>
Here be Dragons