# pkgng Beta



## wblock@ (Jan 30, 2012)

From the ports-announce mailing list:



> [HEADSUP][CFT] pkgng beta1 is out
> 
> Baptiste Daroussin
> 
> ...



Full 250-line message here


----------



## achix (Jan 31, 2012)

Sounds good. Also some mechanism/hooks to peculiar upgrade situations would be nice to model. There must be such a mechanism if source compilation continues to be the main way of doing it.


----------



## andyzammy (Jan 31, 2012)

It sounds as though /usr/src/UPDATING is still going to be part of the ports implementation. I'm only just beginning to get a hang of using the ports system (with respect to upgrading - initial installs have been fine), so I haven't seen a really deep UPDATING entry, but the one's I've seen so far are along the lines of "X is depricated so uninstall X and use Y from now on", or "X has been split up into Y and Z so install and recompile -R and -r dependencies".
These types of workarounds look like they could be automated. Is there any reason why that isn't happening? I did a quick search on UPDATING documentation but couldn't really find any, if anybody has any links to shed light on it that would be great too.

Also, could someone post a complex UPDATING entry? That would probably show me.


----------



## piggy (Jan 31, 2012)

achix said:
			
		

> Sounds good. Also some mechanism/hooks to peculiar upgrade situations would be nice to model. There must be such a mechanism if source compilation continues to be the main way of doing it.


I agree, and I add: we don't need the same old third party, command line tool again.

All this situation it is simply to solve like I said before: just FreeBSD Foundation have to invest on a binary upgrade server updated in the same time with the ports code collection and build a simple tool to use that server. Graphical is better, text is ok too.

So I'm totally disinterested in that new third party project called pkgng and I haven't want to try it.


----------



## avilla@ (Jan 31, 2012)

piggy said:
			
		

> So I'm totally disinterested in that new third party project called pkgng and I haven't want to try it.



This is not a third party application... It will completely replace pkg_add(1).


----------



## phoenix (Jan 31, 2012)

piggy: pkgng is *exactly* what you are asking for.  If you would take your head out of the sand for 10 seconds, you would notice that.  Everything you have been screaming repeatedly over and over again about ... is being done in pkgng.  With the sole exception of being graphical.

But, I guess you just want to rant and rave over and over again about the same point, instead of actually investigating possible solutions and getting things done.


----------



## aragon (Jan 31, 2012)

Bombdiggity I can't wait to test this.  I have first hand experience (read: pain) with the brokenness of pkg_install.


----------



## piggy (Jan 31, 2012)

phoenix said:
			
		

> piggy: pkgng is *exactly* what you are asking for.  If you would take your head out of the sand for 10 seconds, you would notice that.  Everything you have been screaming repeatedly over and over again about ... is being done in pkgng.  With the sole exception of being graphical.
> 
> But, I guess you just want to rant and rave over and over again about the same point, instead of actually investigating possible solutions and getting things done.


Ok Phoenix, I will try it as fast as I have some spare time and a machine to experiment with.


----------



## aragon (Feb 8, 2012)

I stumbled upon this:

http://www.youtube.com/watch?v=IRa6wFBLU28

Looks pretty cool... and that's 4 months old.


----------



## da1 (Feb 8, 2012)

Really looking forward to seeing that one.


----------



## gkontos (Feb 8, 2012)

It is really very good in action. I did some tests on a old desktop that I have. Setting up x11/xorg-minimal was a matter of a few minutes. The only problem is that I have found only 2 repositories which have vey old packages.


----------



## phoenix (Feb 8, 2012)

The database backend side of things work really well.

The patch to portmaster to make it use the pkgng database works really well.

Unfortunately, there's no i386 package repo available anywhere, so that's as far as I've been able to test.  For now, I'll continue to use pkg_upgrade (from sysutils/bsdadminscripts).  It's not perfect (and slow), but at least it works with the existing packages.

Definitely a lot of potential in pkgng!!


----------



## pkubaj (Feb 10, 2012)

There's beta 2 already. But I'm not sure, but I think there's a bug in a patch for portmaster. Having patched it, it still wanted to upgrade the ports according to what *pkg_version* shows. I read through the patch and ran 
	
	



```
export use_pkgng=1
```
 which made portmaster run as it should. That's why I think that there should be some if that would set the value of use_pkgng.


----------



## phoenix (Feb 10, 2012)

You have to add 
	
	



```
use_pkgng=yes
```
 into /usr/local/etc/portmaster.rc (or your personal .portmasterrc) file.


----------



## jb_fvwm2 (Feb 11, 2012)

Beta3 is already here. I would run 
	
	



```
portmaster check-depends && pkgdb -F --omit-check
```
 first if convenient. (Less errors running the following code box)...(BTW Found one port which had to be removed temporarily for ) 
	
	



```
pkg2ng
```
 ( to run to completion. ) (Using unpatched portmaster so far... not a lot of time to test.)
Also, 
	
	



```
script -a pkg2ng.log pkg2ng
```
 found many conflicts... such as  weblint; p5-HTML-Lint  etc etc ("they install into the same place" a file)


----------



## phoenix (Feb 11, 2012)

*pkgdb* is part of ports-mgmt/portupgrade.  If you're using portmaster, why would you have portupgrade installed?


----------



## jb_fvwm2 (Feb 11, 2012)

To keep 
	
	



```
pkgdb -F --omit-check
```
 around... unsure of its exact replacement with other tools... (It informs of stuff I've accidentally desinstalled, for instance.)


----------



## pkubaj (Feb 11, 2012)

jb_fvwm2 said:
			
		

> To keep
> 
> 
> 
> ...



What about `# portmaster --check-depends` ?


----------



## jb_fvwm2 (Feb 12, 2012)

pkubaj said:
			
		

> What about `# portmaster --check-depends` ?



It works similarly, maybe could serve as a replacement ( I run it with the "-y" parameter).


----------



## webugz (Feb 25, 2012)

*FreeBSDâ€™s new package manager - pkgng*

For those who have not already known. A new FreeBSD's package manager, pkgng, is brewing.
Here is an interesting article on it:
http://www.mebsd.com/make-build-you...rst-look-at-freebsds-new-package-manager.html

Enjoy.


----------



## DemoDoG (Feb 26, 2012)

Wow is this for real?


----------



## renice (Feb 26, 2012)

There's already a useful thread about *pkgng*:
http://forums.freebsd.org/showthread.php?t=29397&highlight=pkgng


----------



## webugz (Feb 26, 2012)

Thanks! I missed that.


----------



## DutchDaemon (Feb 26, 2012)

[ Merged -- Mod. ]


----------



## DemoDoG (Feb 27, 2012)

Does it work good enough so that I could install Xorg and a small window manager with pkgng and get the same versions as I get from ports?


----------



## phoenix (Feb 27, 2012)

There's currently no binary package support, in that there are no public repos as yet.

However, you can use portmaster (with the pkgng patch) to install stuff from the ports tree, and register it in the pkgng database.  Then you can use the pkg(1) tool to query the database, remove packages, create packages, etc.

Once it's out of beta and ready for more widespread use, then public repos of binary packages will be created.


----------



## yoxter (Feb 27, 2012)

*great*



			
				aragon said:
			
		

> I stumbled upon this:
> 
> http://www.youtube.com/watch?v=IRa6wFBLU28
> 
> Looks pretty cool... and that's 4 months old.



*L*ooks good, *I* want *to* see it *i*n ports. *L*ooks better than pacman.


----------



## piggy (Mar 3, 2012)

yoxter said:
			
		

> *L*ooks good, *I* want *to* see it *i*n ports. *L*ooks better than pacman.


It surely does not look better than pacman bec*a*use of the mess represented by the Freebsd FreeBSD binary repositories. It look*s* more like pkg from Solaris 11, then pkg it is completely another story. It is a mature software, made by a professional software house for a professional distro and bec*a*use of this it work*s* like a charm when pkgng is the same, old mess again bec*a*use of the lack of professionality in the FreeBSD world related with package management. That was and that still is the real black hole of an excellent OS. And this is also the reason bec*a*use I did the same step back I did 15 years ago moving pretty much 95 per 100 of my FreeBSD administered machines to Solaris and Archlinux.


----------



## UNIXgod (Mar 3, 2012)

Would one of the mods be kind enough to ban piggy from this forum. He or she provides no substance in his or her posts and is a borderline troll that thread-jacks posts often.


----------



## DutchDaemon (Mar 3, 2012)

Maybe piggy could be persuaded to move 100 percent of his servers away from FreeBSD and call it a day? Just an idea. Moreover: this is an end-user forum. Constructive criticism about developments in the base system belongs on the mailing lists where its developers and committers converge and where they may be inclined to respond and take suggestions on board. That is not going to happen in here, where it basically amounts to no much more than a pointless and largely ignored series of rants.


----------



## kpa (Jun 26, 2012)

Giving this thread a well deserved bump. PKGNG is easily one of the best new developments in FreeBSD. It's now in a state where just about anyone could start using it in place of the old pkg tools.

Link to the PKGNG wiki:

http://wiki.freebsd.org/pkgng

I had very little trouble converting my system to pkgng, few packages had corrupted dependencies in /var/db/pkg and I had to delete them first and reinstall them afterwards with pkgng aware portmaster(8) but otherwise the conversion was very painless.


----------



## jb_fvwm2 (Jun 26, 2012)

Here, pkg2ng always halts on nullmailer despite it reported being fixed a few versions ago.  Also, the png2ng reports "some ports could not be registered" (paraphrased, less than one percent of them.). Maybe a third issue, but I've forgotten since yesterday.


----------



## kpa (Jun 26, 2012)

You can start with what pkg2ng manages to convert and once you have your favorite ports management tool set up to use pkgng you can reinstall the ports that didn't register properly.


----------



## kpa (Jun 27, 2012)

There's one handy feature that is not enabled by default and that's tracking of shared libraries. To enable it you have to add this to /usr/local/etc/pkg.conf:


```
SHLIBS: YES
```

Now you can query for example which packages link libxml2.so.5 


```
# pkg shlib libxml2.so.5
libxml2.so.5 is linked to by the folowing packages:
libxml2-2.7.8_3
netpbm-10.35.85
```

Of course you'll have to recompile all ports to have the shared library linking information in the database. The above example is incomplete because I had only graphics/netpbm recompiled with SHLIBS set to YES.


----------



## jb_fvwm2 (Jun 27, 2012)

kpa said:
			
		

> You can start with what pkg2ng manages to convert and once you have your favorite ports management tool set up to use pkgng you can reinstall the ports that didn't register properly.



Sort of hesitant to do that, I've 38 that did not register (besides nullmailer). About five have newly official conflicts or other unofficial ones. About four have vulnerabilities. Only one I anticipate using this year.

So I'd rather wait until the  pkg  port goes through version revisions which may help it register a larger percentage on its own sometime in the next year(s)...


----------



## kpa (Jun 27, 2012)

Make sure you have a consistent /var/db/pkg database before conversion, portmaster(8) can fix most of the problems:

`# portmaster --check-depends`
`# portmaster -s`
`# portmaster --check-port-dbdir`


----------



## graudeejs (Jun 27, 2012)

What's the proper way to update pkgng?


----------



## kpa (Jun 27, 2012)

Right now it's to install port ports-mgmt/pkg and run the pkg2ng conversion tool. The wiki has instructions how to use the ports management tools like ports-mgmt/portmaster and ports-mgmt/portupgrade with pkgng.

Note that the pkgng tools do not replace the old tools and the old package database in subdirectories of /var/db/pkg is left intact after the conversion so you'll have to keep in mind which set of tools you're using, especially if you have your own scripts that use the old pkg tools.


----------



## kpa (Jun 27, 2012)

There are some problems with the SHLIBS feature, pkg(8) can core dump with certain ports when scanning for shared libraries. The work around is to set SHLIBS to NO in enviroment for such ports.

`# env SHLIBS=NO portmaster print/teTeX-base`

print/teTeX-base was the first such port I found.


----------



## frijsdijk (Jul 6, 2012)

I've given it a try, and I think it's very promising. However, one thing that I can't find or understand.. If I install php5 for instance, I get the CLI only, no apache module. There seems to be no seperate package for the apache module. Is the only way to build my own repos?

And, the conversion of the usual ports structure, or pkg_* structure is possible, but it doesn't seem to work the other way around? Installing a package with pkg does not give me any entry in /var/db/pkg. So using both together doesn't seem an option. Am I right?


----------



## kpa (Jul 6, 2012)

Pkgng doesn't change the breakdown of ports in any way, it just updates the package database into a much better one. If the precompiled (with default options) lang/php5 package didn't have the apache module before pkgng it won't have it in pkgng either. You do have the advantage of knowing the options that were set or unset when the package was made in pkgng.

The directories and files under them in /var/db/pkg are rendered obsolete by pkgng, the old database can not express some of the properties of the pkgng database so there is no good way to convert the information backwards. I deleted the subdirectories of /var/db/pkg as soon as I was convinced pkgng works well enough for me. This of course means that you have to update scripts that depend on the old pkg tools to use the pkgng tools to work.


----------



## jb_fvwm2 (Jul 6, 2012)

kpa said:
			
		

> Pkgng doesn't change the breakdown of ports in any way, it just updates the package database into a much better one. If the precompiled (with default options) lang/php5 package didn't have the apache module before pkgng it won't have it in pkgng either. You do have the advantage of knowing the options that were set or unset when the package was made in pkgng.
> 
> The directories and files under them in /var/db/pkg are rendered obsolete by pkgng, the old database can not express some of the properties of the pkgng database so there is no good way to convert the information backwards. I deleted the subdirectories of /var/db/pkg as soon as I was convinced pkgng works well enough for me. This of course means that you have to update scripts that depend on the old pkg tools to use the pkgng tools to work.



You, or someone else, may know the answer to several questions.

1... If one has a program installed, but failed to register (binaries present but
/var/db/pkg creation failed), is there a way to add it to pkg? 
2... I've repeated terse error results using several forms of  
	
	



```
pkg register -l -f -m /var/db/pkg...
```
...Is there a correct way to do that?
3... pkg2ng catches quite a lot of ports that do not register because two ports install
files into the same place.  Is there a way to fix it so they would register (something
like q. 1 above) ?

Unsure if I'd put the answers to use soon, so no great importance...


----------



## kpa (Jul 6, 2012)

1) 2) I didn't bother trying to fix stuff that had broken/missing/corrupted /var/db/pkg entries and caused pkg2ng to skip them. I deleted and reinstalled those ports.

3) Multiple ports that install the same exact files will not work in pkgng because each file can have only one owner package. Ports that install files into directories owned by some other port will continue to be a problem if the ports are deinstalled out of order.


----------



## atmosx (Jul 8, 2012)

That's my first day with FreeBSD and to tell you the truth, this tool solves all the issues I've encountered  in day-1. Good timing


----------



## jb_fvwm2 (Jul 12, 2012)

The latest version of pkg...as far as I can tell...  after 
	
	



```
pkg2ng
```
 had moved all the packages that successfully registered from /var/db/pkg to /var/db/pkg.bak, I was worried until I moved them back (Don't ask me how) and deinstalled pkg... This is a radical change in its result AFAIK.


----------



## kpa (Jul 12, 2012)

You are supposed to run pkg2ng ever only once and then forget that it exists. The change was to remedy a situation where you run it again unnecessarily overwriting the existing database.


----------



## stefanlasiewski (Jul 12, 2012)

kpa said:
			
		

> The wiki has instructions how to use the ports management tools like ports-mgmt/portmaster and ports-mgmt/portupgrade with pkgng.



Are you talking about http://wiki.freebsd.org/pkgng ? That page doesn't appear to have any instructions on using portmaster, portupgrade or portmaster with pkgng. 

-= Stefan


----------



## kpa (Jul 12, 2012)

There is a link to the FAQ:
https://github.com/pkgng/pkgng/blob/master/FAQ.md


----------



## jb_fvwm2 (Jul 13, 2012)

I could not see in the FAQ how to tab-complete "into pkg" rather than "into /var/db/pkg/ while...

```
portmaster -d -B -P -i -g [FILE]/var/db/pkg/...[/FILE] [FILE]/var/db/pkg/...[/FILE]
```
. Will that have an
equivalent? The shell autocompletes the command... typing a few characters of the pkg-name in full, and this helps
portmaster  choose only one port where if it was given a more inexplicit term, it may want to
upgrade more packages without cause.


----------



## jrm@ (Jul 13, 2012)

I'm missing the tab completions too.

pkgng still stores details of installed packages in /var/db/pkg, but they are now in an sqlite database.  This means setting up tab completion isn't simply a matter of changing a path in the zsh/bash completions.


----------



## kpa (Jul 13, 2012)

This gives you completion based on package origin for installed packages (or just the full package name if you drop the -o option) in tcsh(1), I'm sure you can whip up something similar for other shells using the same idea:


```
complete portmaster 'p/1/`pkg info -qao`/'
```


----------



## kpa (Jul 17, 2012)

kpa said:
			
		

> This gives you completion based on package origin for installed packages (or just the full package name if you drop the -o option) in tcsh(1), I'm sure you can whip up something similar for other shells using the same idea:
> 
> 
> ```
> ...



This should be of course:


```
complete portmaster 'p/*/`pkg info -qao`/'
```

With the asterisk completion works on all parameters for portmaster


----------



## ManaHime (Jul 26, 2012)

Any idea if this can be achieved with zsh?


----------



## Davsjo (Jul 28, 2012)

What happens if you run "make install" to install ports on a system with pkgng? Will the installation be registered in the old database or the pkgng database? Portmaster seems to be mentioned now and then; is it currently best to install new ports using it in the patched version that is pkgng aware?


----------



## kpa (Jul 28, 2012)

If you have WITH_PKGNG=1 in /etc/make.conf the files installed by the port will be registered in the pkgng database. Otherwise the old pkg tools will be used. If you use ports-mgmt/portmaster with pkgng the patch is mandatory because without patch it will use the old pkg tools to query the package database and won't be aware of packages installed with pkgng.


----------



## vermaden (Jul 28, 2012)

PKGNG is at 1.0-RC1 already.


----------

