# Upgrading to Perl5-5.18 with pkg and poudriere



## getopt (Nov 27, 2014)

The default Perl has been switched to perl5-5.18 making upgrading tasks necessary. I’m working with Poudriere and Pkg which works just fine.

Question is how to upgrading Perl should be done properly on clients. I did run into these problems:


the repository still has Perl5-16 and Perl5-18
Pkg does not offer substitution, at least I’m not aware of this
`pkg delete perl5` deletes also dependent packages, which are a lot.
After 
	
	



```
pkg install perl5-5.18
pkg upgrade –y
pkg check -Ba
```
the dependent packages seem to be gone for good. How do you upgrade your clients without pain?

PS: There is something wrong with the forum software: formatting cannot be done, as it is undone permanently when edited.


----------



## Beeblebrox (Nov 27, 2014)

Please clarify several things:


> the repository still has Perl5-16 and Perl5-18


Do you want your clients to use Perl5-16 or not? If not, you should clean out your repo for the Perl5-16 related packages.
`# poudriere pkgclean -j <jail_name> && poudriere distclean -j <jail_name>`

How do you run poudriere? This is what you should do periodically:

Create a list of all packages installed: `$ pkg info -aoq > complete.lst`. Add to this list or combine with separate file you keep for additional ports, so as to maintain it properly.
Periodically do a full poudriere run. This will clean out your stale binaries, and re-build everything that has changes (which is quite a bit surprisingly): `# poudriere bulk -j <jailname> -f complete.lst`

Use the DEFAULT_VERSIONS flag in your poudriere.d/make.conf. See Mk/bsd.default-versions.mk

Before running poudriere, run `# portmaster -a`, which will allow you to set configuration paramaters for all ports that have new config options. This is easier than `poudriere options`, but will NOT work if you plan on maintaining different options for each build jail. This means, all clients use same ports configs.

For above to work, you must also have mounted as below, but also provide symlink to options folder from jailname.options. If you have not yet done this, you may have to go through the entire config process once more or try merging the different options.


```
/var/db/ports    /usr/local/etc/poudriere.d/options   nullfs   rw 0 0
```


----------



## DutchDaemon (Nov 27, 2014)

Formatting: must be something wrong on your side, or everybody would have problems. I edit and format on Chrome and Firefox, on laptop and on mobile.


----------



## kpa (Nov 27, 2014)

The /usr/ports/UPDATING file tells you to do `pkg upgrade -f`. This worked just fine for me at least, the downside of it is of course that you have to reinstall every single installed package but it can't be avoided because so many ports have changed.


----------



## jb_fvwm2 (Nov 27, 2014)

I tend to  pkg install  only the majority of upgrades weekly.  This is broken, and remains so... whereas yesterday installing a new port (for test sysutils/sec) resulted in the command wanting to install five or so unrelated ports, now SEVEN or so unrelated ports are needed.   gnome-keyring; libEGL; clutter....  Short of writing a frontend script to "sort of" fix it here, is there any suggested way to remedy this bug?  I've reported it to the lists and a thread already. I'd even like to  `pkg` [ -annotate, -bootstrap -shell... ]  if possible the local local.sqlite to remove the spurious entries, if that is feasible.


----------



## wblock@ (Nov 27, 2014)

jb_fvwm2, I don't often use the word "dude", but in this case:

Dude, someday you will update ports and packages normally, not picking and choosing, and many of your problems will disappear.  The "unneeded" ports are what the package needs.  Skip them, and expect problems.


----------



## jb_fvwm2 (Nov 27, 2014)

sysutils/sec  requires perl; gcc; binutils...  ... OTOH my post above showed ignorance of the switches to the `pkg info -F` command, with which `pkg upgrade  -F` first downloading the updates, I may [ the theory anyway ] be  halfway, or thereabouts, to a scripted  not-too-unwieldly [here anyway] scripted workaround, though it may take a few revisions to become worthy of posting.  Eventually either of those commands may acquire additional parameters, or portmaster catches fully upto `pkg` compatibility... or some other unknown.


----------



## jb_fvwm2 (Nov 27, 2014)

The first working beta of the workaround mentioned above is failing with an error:

```
# pkg add at-sp2-atk-2.14.1-9b1ad21816.txz
Installing at-spi2-atk-2.14.1...
the most recent version of at-spi2-atk-2.8.0_1 is already installed
```
If`pkg add` would in this instance be a bit correct... I wonder if the other `pkg` problems here would mitigate somewhat...


----------



## jb_fvwm2 (Nov 27, 2014)

Temporary workaround found, however...  Having earlier found the ftp/curl from-a-one-liner list of to-be-reinstalled ports, `portupgrade -P` seems to work with a few of them (same perl version as here, etc excepted maybe ) and since the package files, as above, were downloaded, can probably be put in a shell one-liner or script.
Apologies if these posts go in another thread...


----------



## jb_fvwm2 (Nov 27, 2014)

Forgot to mention a part of that fix...

```
mv /usr/ports/packages/All All.bak
mkdir All
ln -s /var/cache/pkg /usr/ports/packages/All
# not its location here, specifically... the cache
```


----------



## DutchDaemon (Nov 27, 2014)

I concur with wblock@, and I think I've already told you this a long time ago: your way of doing port upgrades and installs is entirely idiosyncratic (there's another word in there, but I'm not going there), and, as far as I'm concerned, exactly the wrong way to go about it. I think your posts on the ports forum should come with a disclaimer or a warning label.. No offense intended, dude, but you're making your own life miserable by persevering. I just hope that other users understand that what you're posting as solutions.. usually aren't. It's a lot of duct tape. I _know _that you're trying to help, but maybe you should be aware of what your public responsibilities are in doing so from such a non-mainstream _modus operandi._


----------

