Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

TT1 *NIX 1: FreeBSD's Ports System


TT1 *NIX 1: FreeBSD's Ports System

By ghostghost | 4762 Reads |
0     0

In FreeBSD, we have a system that makes installation software as easy as one command. In short, the ports are basically a giant collection of snapshots of different software packages, hidden away in /usr/ports, where only root can touch. As root, you cd to /usr/ports, find the category you want, then the directory for the software you want.

Specifically, the ports system is just a few files and a makefile, to download everything you need.

Let's say I want to grab CVSUP, and I've never had it installed before.

cd /usr/ports

cd net (this is cvsup's category)

cd cvsup (note that since we're in the category's directory, we could grep to find the port we want.)

Now heres the most important step-

make install

And that's it. It's done. All installed, it autogets the dependencies and everything, just like that. This makefile works for install, deinstall, reinstall, search, and whatnot.

Lets say we want to update our snapshot of the ports collection. Kinda weird that I use CVSUP for my example, eh?

Well once you have that done, you have a file in your /usr/share/examples/cvsup called ports-supfile. Edit the file with Vi, EE, Emacs, or whatever you choose, and theres two lines two lines of interest for you right now. First off, a supfile is a file that tells cvsup what to download, where to put it, and where to get it from. In the example file, all you need to change is the where from.

These two lins of interest are somthign along- #*default host = CHANGE_THIS.FreeBSD.org *default host = CHANGE_THIS.FreeBSD.org The only difference is one is commented out. Big difference. Find the latter of the two, and change CHANGE_THIS to cvsup. Save the file and exit your text editor.

Now, run this!

cvsup -g -L 2 /usr/share/examples/cvsup/ports-supfile

And it'll grab all the updated ports collection for you.

Updates, says who?! If your intelligent, you know that you always have to update your software for security, or new feautres. Whatever. One option is running # portaudit -F before you install a package, to check the package you install for vulnerabilities.

Updating is as simple as # portupgrade. Check the man page for usage details, but basically portupgrade without flags is upgrade all ports iin your database, and adding a flag of a packagename is a specifc package upgrade.

Easy as Pie!

Comments
Sorry but there are no comments to display