# /var/db/pkg and /var/db/ports



## skoinga (Jun 13, 2010)

Hi,

I've just installed FreeBSD 8 release.
I've installed, in this order,

links
xfce4
xorg

all via the "ports" system (make install clean...)

Now, in the /var/db/pkg I see 324 directory, listing several programs (I know: there are dependencies), while in /var/db/ports I see:


```
# ls
ImageMagick gconf2 libiconv pixman xfce4-utils
Terminal ghostscript8 librsvg2 python26 xfce4-wm
Thunar glib20 libxfce4gui vte xorg-apps
cairo gtk-engines2 libxslt xf86-video-radeonhd xorg-drivers
cups hal libxul xfce4 xorg-server
docbook jasper lynx xfce4-conf
docbook-500 lcms m4 xfce4-desktop
docbook-xsl libexo orage xfce4-panel
gamin libglade2 perl xfce4-print
```

So, what's the meaning of directory /var/db/pkg and /var/db/ports ?
Why I don't see file only in /var/db/ports? I never installed any programs via the "package" system (pkg_add -r something)

Thankyou very much


----------



## avilla@ (Jun 13, 2010)

/var/db/ports keeps information on selected OPTIONS. since not every port defines OPTIONS, there are less entries than in /var/db/pkg, which is the database of installed packages

it's also used by ports-mgmt/portmaster to store information about distfiles, so, if you use that tool, you'll have much more entries


----------



## skoinga (Jun 13, 2010)

Another little question: in FreeBSD, it's correct to label "package" only software installed by pkg_add, and "ports" only software installed by source (from /usr/ports)?
So, when you says:



> /var/db/pkg, which is the database of installed packages



you mean actually "list of installed ports"?
On my system I never user pkg_add, at present.

Thankyou again.


----------



## avilla@ (Jun 13, 2010)

skoinga said:
			
		

> Another little question: in FreeBSD, it's correct to label "package" only software installed by pkg_add, and "ports" only software installed by source (from /usr/ports)?



the distinction is valid when they're not installed. when you have installed something, you can say "i've installed N ports/packages"



> So, when you says:
> 
> 
> 
> you mean actually "list of installed ports"?



yes


----------



## skoinga (Jun 14, 2010)

avilla@ said:
			
		

> the distinction is valid when they're not installed. when you have installed something, you can say "i've installed N ports/packages"



Ok, so how can I distinguish between software installed via ports or packages?
Except the "history" command, of course 

Thankyou again


----------



## SirDice (Jun 14, 2010)

skoinga said:
			
		

> Ok, so how can I distinguish between software installed via ports or packages?


Once they are installed there is no difference. Packages are created from installed ports.


----------



## phoenix (Jun 14, 2010)

The only difference between a port and a package is how they are installed.  Once they are installed, they are treated the same.

/var/db/pkg is the "installed packages" database that lists all the ports/packages installed, their versions, dependency information, and all of the files installed by each.

/var/db/ports is the "options selected for ports" database.  This stores information regarding the option you have selected when installing ports (the blue screen that pops up where you select options).  This is used when upgrading ports so that you don't have to keep selecting the same options over and over each time.  The OPTIONS menu for a port should only appear the first time you install it, and when a new OPTION is added to the menu.


----------



## skoinga (Jun 14, 2010)

Very thanks!!!
Thankyou for great explanations.


----------

