# portmaster and packages (-PP)



## dndlnx (Nov 8, 2011)

New install on my laptop, I'm attempting to use 99% packages. Ports is fine on my little server, but it's too much work in two places.

The -PP switch fails at my first package. That's fine I guess, but it completely aborts and won't do the rest of the list!

I tried various other "long switches" related to packages, but didn't get anywhere. How can I do this?  



```
===>>> Starting install for for ports that need updating <<<===

===>>> Launching child to install misc/figlet
]0;portmaster: All >> misc/figlet (1/255)
===>>> Port directory: /usr/ports/misc/figlet

===>>> Checking package repository for latest available version

===>>> The newest available package (figlet-2.2.1)
       is older than the version in ports (figlet-2.2.4)

===>>> Try --packages-if-newer, or do not use -PP/--packages-only
===>>> Aborting update

===>>> Update for misc/figlet failed
===>>> Aborting update
```

I hope to figure this out. OpenBSD doesn't really do GPT or Flash, and I _really_ don't feel like figuring out Arch. Should I suck it up, and use ports again? :\


----------



## SirDice (Nov 8, 2011)

dbsd said:
			
		

> Ports is fine on my little server, but it's too much work in two places.


Build packages while you're building on the server. You can use them on the other machine.


----------



## dndlnx (Nov 8, 2011)

I hadn't thought about this!

Does it help to keep the same ports on both machines? I don't have any significant extras, like apache or something. It's just a little file server / torrentbox.

I could basically have the same configuration. Then what, I just install everything off the server?


----------



## vermaden (Nov 8, 2011)

dbsd said:
			
		

> New install on my laptop, I'm attempting to use 99% packages. Ports is fine on my little server, but it's too much work in two places.



Try that, works for me both on laptop and personal server: http://forums.freebsd.org/showthread.php?t=26140


----------



## SirDice (Nov 8, 2011)

I use my server to build all my own packages. I use a simple jail for this. The jail will allow you to build everything without interfering with the running system. It also means I build everything from scratch so my dependencies are also always correct. 

After that I just export /usr/ports/ for the ports tree and INDEX file (so all my other machines reference the same ports tree). If you create a /usr/ports/packages/ directory all your built packages will end up there. Easy to export or transfer to another machine.

The pre-build packages on the FreeBSD servers always lag a little. By creating your own you can eliminate this.


----------



## dndlnx (Nov 8, 2011)

So I have some viable solutions then...thanks, guys.

@vermaden, nice write up! Can that method be used on RELEASE?


----------



## SNK (Nov 8, 2011)

What PACKAGESITE are you using? Version 2.2.4 of misc/figlet is available as package.


----------



## dndlnx (Nov 8, 2011)

SNK said:
			
		

> What PACKAGESITE are you using? Version 2.2.4 of misc/figlet is available as package.



So, this is a shell variable? The default, I guess. I've never messed with setting any PACKAGESITE before.


----------



## SirDice (Nov 8, 2011)

dbsd said:
			
		

> So, this is a shell variable? The default, I guess. I've never messed with setting any PACKAGESITE before.



See ports(7) and pkg_add(1).


----------



## SNK (Nov 8, 2011)

See the references from SirDice.

But to summarize: using the default setting for PACKAGESITE will give you old packages, namely those that were enclosed with your install medium.

First look for a nearby mirror at http://www.freebsd.org/doc/handbook/mirrors-ftp.html.

Then, if you are using FreeBSD 9, add your country and architecture and run the following:

`#  echo "setenv PACKAGEROOT [url]ftp://ftp[/url].[COUNTRY].freebsd.org" >> ~/.cshrc`
[cmd=]# echo "setenv PACKAGESITE ftp://ftp.[COUNTRY].freebsd.org/pub/FreeBSD/ports/[ARCH]/packages-9-current/Latest/" >> ~/.cshrc[/CMD]

If you are using FreeBSD 8 then replace 'packages-9-current' with 'packages-8-stable'.


----------



## dndlnx (Nov 9, 2011)

So...I think I've decided to build them, on the other machine. It should be fun! But, lots of new info to absorb! 

I messed with pkg_create in /var/db/pkg, it worked but seems like it would be messy. I'd need a script or something to deal with this. I think sticking with the -g switch to portmaster and/or make package right from the tree is probably better? Am I wrong?


Then I'm mostly just using portmaster. And the -PP switch should then work on my laptop, as it would look in /usr/ports/packages/* first? Or whatever I set for PACKAGES / PKGREPOSITORY variables.

I could then use something like portsclean to get rid of old stuff, as the directory fills up?

Sound reasonable?


----------



## Martillo1 (Nov 9, 2011)

SNK said:
			
		

> See the references from SirDice.
> `#  echo "setenv PACKAGEROOT [url]ftp://ftp[/url].[COUNTRY].freebsd.org" >> ~/.cshrc`
> [cmd=]# echo "setenv PACKAGESITE ftp://ftp.[COUNTRY].freebsd.org/pub/FreeBSD/ports/[ARCH]/packages-9-current/Latest/" >> ~/.cshrc[/CMD]



The directory ../amd64/packages-9-current/.. seems not to exist since a copuple of days. Now tracking ../amd64/packages-9-stable/..


----------



## kpa (Nov 9, 2011)

It may have been changed to packages-9-stable because FreeBSD CURRENT is now version 10.


----------



## vermaden (Nov 9, 2011)

dbsd said:
			
		

> @vermaden, nice write up! Can that method be used on RELEASE?



Generally, yes, just specify STABLE for packages instead of RELEASE here: /usr/local/etc/uma.conf

It will generally work, but some kernel modules (like Virtualbox) which are built upon STABLE tree instead of RELEASE tree may cause problems, other things (that work in userspace) should work without problems.


----------

