# The package manager



## mariourk (Nov 23, 2011)

I managed to install FreeBSD on my server and fiddle around a bit. So far it looks promising.

I've been reading several documents about _Ports_ and I'm still missing some features.

I come from a Gentoo background. _Portage_, the Gentoo package manager, offers the ability to search for packages. _Ports_ seems to be able to do this, but in a very limited and spartan way.

_Portage_ can show all the packages that will be installed as dependencies, before actually installing a package. Can I do this with _Ports_?

The mayor downside of Gentoo is the fact that everything has to be compiled. I was kind of hoping to abandon this on my new server. But until now, All software I installed had to be compiled. I was under the impression that FreeBSD also offered the option the use precompiled packages?

I hope someone can get me on the right track and help me master package management with FreeBSD


----------



## SirDice (Nov 23, 2011)

mariourk said:
			
		

> _Portage_ can show all the packages that will be installed as dependencies, before actually installing a package. Can I do this with _Ports_?


[cmd=]make build-depends-list[/cmd]
[cmd=]make run-depends-list[/cmd]

See ports(7).



> The mayor downside of Gentoo is the fact that everything has to be compiled. I was kind of hoping to abandon this on my new server. But until now, All software I installed had to be compiled. I was under the impression that FreeBSD also offered the option the use precompiled packages?


Handbook: Chapter 5 Installing Applications: Packages and Ports


----------



## mix_room (Nov 23, 2011)

mariourk said:
			
		

> The mayor downside of Gentoo is the fact that everything has to be compiled. I was kind of hoping to abandon this on my new server. But until now, All software I installed had to be compiled. I was under the impression that FreeBSD also offered the option the use precompiled packages?



[cmd=""]man pkg_add[/cmd]


----------



## DutchDaemon (Nov 23, 2011)

Never skip the Handbook ...


----------



## phoenix (Nov 24, 2011)

mariourk said:
			
		

> I come from a Gentoo background. _Portage_, the Gentoo package manager, offers the ability to search for packages. _Ports_ seems to be able to do this, but in a very limited and spartan way.



Install ports-mgmt/psearch.  It should handle all of your searching needs.



> The mayor downside of Gentoo is the fact that everything has to be compiled. I was kind of hoping to abandon this on my new server. But until now, All software I installed had to be compiled. I was under the impression that FreeBSD also offered the option the use precompiled packages?



pkg_add(1) is the binary packages installation tool.  There are several *pkg_** tools, each with their own man page.

And the popular ports management tools (ports-mgmt/portupgrade and ports-mgmt/portmaster) include support for binary packages.

And, if you want a packages-only setup, you can use the *pkg_upgrade* tool that comes with sysutils/bsdadminscripts.


----------



## mariourk (Nov 26, 2011)

I tried [cmd=]make build-depends-list[/cmd] before installing ports-mgmt/portupgrade. It showed Ruby-1.8 as depencency, but it also installed Perl. Why didn't I see that in the dependency list?

When I try to install any package with [cmd=]pkg_add -r packagename[/cmd] the system says it can't fetch the package and quits. What am I doing wrong? :S

Can pkg_add show a list of all dependencies it intends to install, before actually installing a package?


----------



## DutchDaemon (Nov 27, 2011)

You need [cmd=]make all-depends-list[/cmd] to get all dependencies.

See ports(7).


----------



## bbzz (Nov 27, 2011)

mariourk said:
			
		

> When I try to install any package with [cmd=]pkg_add -r packagename[/cmd] the system says it can't fetch the package and quits. What am I doing wrong? :S



What exactly does it say?



> Can pkg_add show a list of all dependencies it intends to install, before actually installing a package?



pkg_add will pull in all dependencies that would compiling ports pull in.


----------



## mix_room (Nov 28, 2011)

mariourk said:
			
		

> I tried [cmd=]make build-depends-list[/cmd] before installing ports-mgmt/portupgrade. It showed Ruby-1.8 as depencency, but it also installed Perl. Why didn't I see that in the dependency list?



There is probably a dependency that has perl as a dependency.


----------



## mariourk (Nov 28, 2011)

bbzz said:
			
		

> What exactly does it say?




```
[root@eddard /usr/ports/www/apache22]# pkg_add -r apache22
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/apache22.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/apache22.tbz' by URL
```


----------



## SirDice (Nov 28, 2011)

The packages-9-current directory doesn't exist. Set PACKAGESITE.


----------



## mariourk (Nov 28, 2011)

This is what I did:

```
export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/
```

After this, *pkg_add* started to fetch the packages! 

I'm wondering if this action permanently changes the PACKAGESITE variable. Or just for this session? If so, how can I set this variable permanently? :q


----------



## kpa (Nov 28, 2011)

tcsh(1), sh(1), http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/shells.html


----------

