To install applications (ports):
To install from the internet, simply connect to the internet.
To install from cdrom, you *must* have your cdrom mounted as "/cdrom"
mount sapphire:/mnt/cdrom /cdrom
xchat example:
1. Change directory to the ports directory:
cd /usr/ports
2. Search for the port you wish to install:
make search key=xchat
3. Change directory to where the port is located:
cd /usr/ports/irc/xchat
4. Compile the port:
make
5. Install the compiled port:
make install
Note: You can avoid the previous two steps by simply typing:
make install
To deinstall the port, simple change to its port directory and:
cd /usr/ports/irc/xchat
make deinstall
To reinstall the port, simple change to its port directory and:
cd /usr/ports/irc/xchat
make reinstall
-----------------------------------------------------------------------------
If you download tarball in a fashion other than the ports method, and want
to install them, place in folder:
/usr/ports/distfiles/
-----------------------------------------------------------------------------
Does the ports scheme only work if you have everything in /usr/ports?
My system administrator says I must put everything under
/u/people/guests/wurzburger, but it does not seem to work.
You can use the PORTSDIR and PREFIX variables to tell the ports mechanism
to use different directories. For instance,
make PORTSDIR=/u/people/guests/wurzburger/ports install
will compile the port in /u/people/guests/wurzburger/ports and install
everything under /usr/local.
make PREFIX=/u/people/guests/wurzburger/local install
will compile it in /usr/ports and install it in
/u/people/guests/wurzburger/local.
And of course,
make PORTSDIR=../ports PREFIX=../local install
-----------------------------------------------------------------------------
I do not have a FreeBSD CDROM, but I would like to have all the tarballs
handy on my system so I do not have to wait for a download every time I
install a port. Is there any way to get them all at once?
To get every single tarball for the Ports collection, do:
cd /usr/ports
make fetch
For all the tarballs for a single ports directory, do:
cd /usr/ports/directory
make fetch
-----------------------------------------------------------------------------
I know it is probably faster to fetch the tarballs from one of the FreeBSD
mirror sites close by. Is there any way to tell the port to fetch them from
servers other than the ones listed in the MASTER_SITES?
Yes. If you know, for example, that ftp.FreeBSD.org is much closer to you
than the sites listed in MASTER_SITES, do as follows:
cd /usr/ports/directory
make MASTER_SITE_OVERRIDE= ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch
-----------------------------------------------------------------------------
I want to know what files make is going to need before it tries to pull
them down.
make fetch-list
will display a list of the files needed for a port.
-----------------------------------------------------------------------------
Is there any way to stop the port from compiling? I want to do some hacking
on the source before I install it, but it is a bit tiresome to watch it and
hit control-C every time.
make extract
will stop it after it has fetched and extracted the source code.
-----------------------------------------------------------------------------
I installed the grizzle program from the ports and frankly it is a complete
waste of disk space. I want to delete it but I do not know where it put all
the files. No problem, just do:
pkg_delete grizzle-6.5
Alternatively, you can do:
cd /usr/ports/somewhere/grizzle
make deinstall
-----------------------------------------------------------------------------
Hang on a minute, you have to know the version number to use that command.
You do not seriously expect me to remember that, do you?
Not at all, you can find it out by doing:
pkg_info -a | grep grizzle
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter
and shoot 'em up arcade game.
-----------------------------------------------------------------------------
Talking of disk space, the ports directory seems to be taking up an awful
lot of room. Is it safe to go in there and delete things?
Yes, if you have installed the program and are fairly certain you will not
need the source again, there is no point in keeping it hanging around. The
best way to do this is:
cd /usr/ports
make clean
which will go through all the ports subdirectories and delete everything
except the skeletons for each port. To remove the tarballs:
make distclean
-----------------------------------------------------------------------------
Source:
http://www.freebsd.org/handbook/ports.html