# portmaster not using pkgng



## scottro (Sep 22, 2013)

I have gone through the using pkgng docs and googled this, but not only can I not find my mistake, I can't find anyone else with the same problem. 

As I understand it, if I add 
	
	



```
WITH_PKGNG=yes"
```
 to /etc/make.conf portmaster(8) should use pkg(8).  If I edit /etc/make.conf before installing any packages from ports, this should work without running `pkg2ng`.

To confirm that whatever I'm doing wrong, I'm at least doing consistently, I've just tested this on a fresh installation of FreeBSD-9.2-RC4.

I made a fresh install.   I then ran
`/usr/sbin/pkg` which installed pkg.

I then edited /etc/make.conf (I created the file, actually, as this was the first entry), adding 
	
	



```
WITH_PKGNG=yes
```
.  I confirmed that there were no typos.  I then ran `portsnap fetch extract` to build a ports tree.

Now that I had the ports tree, I changed directory into /usr/ports/ports-mgmt/portmaster and ran `make install clean`

I now ran `pkg info` which showed that I had pkg(8) and portmaster(8) installed.  (As well as dialog4ports(1), pulled in by portmaster(8).



With this done I tried `portmaster -a`.  This should show that /usr/ports/ports-mgmt/pkg needs updating, as the earlier `/usr/sbin/pkg` pulls in an older version than exists in ports.  However, it gives a message that no packages require an update.  I then ran `portmaster -L` which shows me that 0 ports are installed.  

Ergo, I am doing something wrong, but looking at the documents, and googling (with strings like pkgng portmaster, portmaster ignoring local.sqlite, and similar things) hasn't given me an answer.  Therefore, I'd be grateful if someone would point out what I'm missing.  (And, if they were really kind, tell me what documentation I've overlooked or misread.)


----------



## kpa (Sep 22, 2013)

Make sure you have an up to date ports-mgmt/pkg installed, don't trust that the /usr/sbin/pkg bootstrap installs the latest available version.


----------



## scottro (Sep 22, 2013)

Thank you @kpa, that solves the more pressing issue, and means that I can now use pkgng with portmaster(8). On the test machine, I first removed pkg(8) and portmaster(8) then installed pkg(8) from ports. Upon reinstalling portmaster(8), it was able to see the already installed packages. Any package installed with portmaster(8), rather than adding to local.sqlite puts a directory in /var/db/pkg, but I can figure that out later. It may be expected for all I know.  My bigger concern was that I was unable to use it to update installed ports. So many thanks.


[EDIT]
Ok it _seems_ that this creation of the /var/db/pkg/<subdirectory> is expected.  It contains nothing but portmaster(8) caching of distfile info.  Not sure if that's expected to be fixed by now or not (the post I saw is almost a year old) but I can live with it.  Again, thanks to kpa who gave me the solution.


----------

