LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   FreeBSD Package Manager (https://www.linuxquestions.org/questions/%2Absd-17/freebsd-package-manager-18950/)

rsbecker007 04-19-2002 06:19 PM

FreeBSD Package Manager
 
Is there one?

The reason I ask is that I just installed FreeBSD 4.5 and wanted to use lynx, but it wasn't installed. I found a .tgz file in the packages subdir of the first CD for lynx. I uncompressed it and found subdirs that I could manually place, but it would seem to me that there would be a package manager since it is in the packages subdir...

sancho5 04-19-2002 06:30 PM

Not sure how FreeBSD does it, but Open- has both a package manager and a ports tree. The package management commands are pkg_add, pkg_delete, and pkg_info, to name a few. The .tgz files are precompiled packages that you can install with pkg_add <pkgname.tgz>.

Check the online FAQ or user's manual or try the man command to search for a keyword:
Code:

man -k pkg
might show you what you want.

rsbecker007 04-19-2002 06:48 PM

Thanks!
 
that really helped a lot, thanks!

shakazulu 04-19-2002 08:48 PM

pkg_add
 
FreeBSD has a slightly schizophrenic package system (mostly due to their somewhat independent evolution).

If you have the lynx.tgz file like you say then that is a package and you do

pkg_add lynx.tgz

(this will complain if the dependencies are not installed)

If you do not have lynx.tgz you can do

pkg_add -r lynx.tgz

and it will try to download it and its dependencies.

The easiest way I have found to get something and its dependencies installed off the CD is to unmount it, and then do
/stand/sysinstall
then select Configuration
then select Packages
then select the CD/DVD distro option
then select www
then select lynx

This -should- ensure that the package and its dependencies all come in.

Lastly, if (and it does happen) that the .tgz file cannot be found online or on CD, then you can do

cd /usr/ports/www/lynx

and type

make
make install
make package (optionally make a .tgz file)

which will download source and compile. Additionally, the make might give you options to set to get alter the compile (for example, the mplayer port has to be told to make with libdecss).

BTW if you did not know the right directory to go to you can type

whereis lynx

or

cd /usr/ports
make search key=lynx

Now one big diff between OpenBSD and FreeBSD is that OpenBSD automatically creates the .tgz packages and then does a package install of the .tgz file. I think that's a lot nicer and neater, because it essentially reduces all pkg installation to a call pkg_add, so there is less chance for the pkg commands to clobber the port commands and vice versa (which theoretically can happen, but doesn't).


Bottom line, use ports and pkg whenever possible. Don't just do the untar, config, make business if you want to keep you pkg database coherent.

sancho5 04-20-2002 02:54 PM

while on the subject, i don't know if FBSD takes care of it, but when installing a port, you can specify the 'make clean' option at the end. Reason being, if you leave a downloaded and compiled package sitting around on your system in ports, it's gonna take up space. multiply this by several ports you've built, you're going to have a lot of wasted space and have fun tracking it down ;)
Make clean takes the port back to its original (small) pre-built size.

cvig 04-21-2002 02:01 PM

portupgrade
 
Check out portupgrade too. It is simply wonderful. Say you have 15 packages installed and 5 are out of date. Running portupgrade -ra will upgrade all those packages and their dependencies. The downside is the length of time it takes to update the db portupgrade uses (portsdb -Uu) but considering it requires no interaction and only needs to be run once a week I find portupgrade to be wonderful.

Remember to add the WITHOUT_X11 option to /etc/make.conf (man make.conf) if you don't want to build any of the X11 stuff or specify it on the command line with portupgrade -ra -m "-DWITHOUT_X11".

Michael Lucas has an excellent article on portupgrade:
http://www.onlamp.com/pub/a/bsd/2001...y_Daemons.html

Check out his other articles in the Big Scary Daemons section:
http://www.onlamp.com/pub/ct/13

Good stuff.

5amYan 04-25-2002 03:29 AM

as root
/stand/sysinstall


All times are GMT -5. The time now is 04:00 AM.