# portmaster fails to upgrade ports-mgmt/pkg



## Linnet (Oct 2, 2020)

```
===>>> Currently installed version: curl-7.72.0
===>>> Port directory: /usr/ports/ftp/curl
    ===>>> This port is marked IGNORE
    ===>>> pkg(8) must be version 1.15.6 or greater, but you have 1.14.5. You must upgrade the ports-mgmt/pkg port first

    ===>>> If you are sure you can build it, remove the
           IGNORE line in the Makefile and try again.

===>>> Update for curl-7.72.0 failed
===>>> Aborting update

cd ports-mgmt/pkg

sudo make build install
===>  Installing for pkg-1.15.6
===>  Checking if pkg is already installed
===>   An older version of pkg is already installed (pkg-1.14.6)
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of pkg
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.

*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /usr/ports/ports-mgmt/pkg

I tried then with: sudo make build install FORCE_PKG_REGISTER=1
But no luck there.

===>  Installing for pkg-1.15.6
===>   Registering installation for pkg-1.15.6
pkg-static: Requesting argument %2 while only 1 arguments are available
*** Error code 74

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/pkg

*** Error code 1

Stop.

make[1]: stopped in /usr/ports/ports-mgmt/pkg

*** Error code 1

Stop.

make: stopped in /usr/ports/ports-mgmt/pkg
```

Any ideas how to go about this?

/s


----------



## mickey (Oct 2, 2020)

I would try the following:

```
# cd /usr/ports/ports-mgmt/pkg
# make clean
# make
# make deinstall
# make reinstall
```


----------



## a6h (Oct 2, 2020)

It seems to you want to use package system. If that's the case: just type `pkg`. It's going to download pkg.


----------



## richardtoohey2 (Oct 3, 2020)

Did you try what it said?



Linnet said:


> You may wish to ``make deinstall'' and install this port again by ``make reinstall'' to upgrade it properly.



But it might be this issue? The argument %2 stuff - https://marc.info/?l=freebsd-ports&m=160164622602004&w=2


----------



## rpowell47 (Oct 3, 2020)

Did you try:

cd /usr/ports/ports-mgmt/pkg
make deinstall reinstall 

It worked for me yesterday.


----------



## Linnet (Oct 5, 2020)

Morning,

Thanks for the replies. I'm back in office and will try you suggestions. However, just re-install pkg did not work for me last week.
If I re-install pkg it choses the right package (1.15.6). But then other packages fails with the same error pointed out by *richardtoohey2. *I also tried what vigole suggested but that will downgrade pkg.

I will give it a try again today and get back to you.
Regards
/stefan


----------



## richardtoohey2 (Oct 5, 2020)

If you are building from ports then you should get the latest - portsnap fetch update.

pkg is going through some rapid changes - think it's now 1.15.9.






						FreshPorts -- ports-mgmt/pkg: Package manager
					

Package management tool




					www.freshports.org


----------



## richardtoohey2 (Oct 5, 2020)

From your original message you seem to have 1.14.5 or 1.14.6 - so looks like your system was last updated in June 2020?

Not sure what you are trying to do, but make sure you also look in /usr/ports/UPDATING for extra steps you might need to take.


----------



## Linnet (Oct 5, 2020)

richardtoohey2 said:


> From your original message you seem to have 1.14.5 or 1.14.6 - so looks like your system was last updated in June 2020?
> 
> Not sure what you are trying to do, but make sure you also look in /usr/ports/UPDATING for extra steps you might need to take.


Sounds about right. I'm just trying to update my ports, i will fetch and update and try again.

/s


----------



## Linnet (Oct 5, 2020)

===>>> All ports are up to date

Now it worked. I guess that the combination of pkg 1.15.6 the former version of my portstree wasn't too happy. Now with 1.15.9 all are ok.

Steps:
portsnap fetch update
cd ports-mgmt/pkg
make reinstall
cd ../../
portsnap fetch update (not needed i think)
portmaster -a -v

===>>> All ports are up to date

Thanks all for the input.

/s


----------



## Zvoni (Oct 5, 2020)

Since you're using ports i do hope you're not mixing binary packages (sudo pkg install SomePackage) and ports
In that vein: I'm so glad i switched to poudriere.......
you only have to change the conf-file for pkg to use your own built packages.
When i'm home, i'll try to find the forum-thread with the How-To
Since using poudriere i never looked back......


----------



## Linnet (Oct 6, 2020)

Hi Zvoni,

That mistake (mixing bin pkg and ports) i did one time . Please send me the link, i might give it a try.

Regards
/stefan


----------



## Zvoni (Oct 6, 2020)

Found it:








						Pkg package repository using ports-mgmt/poudriere. With or without ZFS.
					

This is a HOWTO on how to build your own ports-mgmt/pkg packages in a jail using ports-mgmt/poudriere.  Few notes about notation:  First few mentions of a ported program will be a "port link", like net/mtr. I will not repeat the link too many times however. I will use a link to a manual page...




					forums.freebsd.org
				




Once you've done the basic setup, it's just a simple workflow of
Updating ports-tree `poudriere ports -u`
Updating jails (optional) `poudriere jails -u`
Running `poudriere options ....` (if new options available)
Running `poudriere bulk.....`

EDIT: There are only two things i don't think are mentioned in that How-To (at least i haven't seen it)
1) install/setup devel/ccache. Would have to look up the params i use. Maybe someone else can chip in with recommendations.
2) in poudriere.conf set the PRIORITY BOOST for ports like LLVM, rust etc.

Something else as for that How_to: Be careful: Some Paths are different to what you might actually use.
e.g.: The How-To tells you to create a Folder for the distfiles in /var/cache . On my system it was at a different location.


----------



## richardtoohey2 (Oct 6, 2020)

For other people using portmaster who get this sort of thing and stumble onto this thread - I got the same sort of thing as the OP from a portmaster -a:

```
===>>> Currently installed version: openssl-1.1.1h,1
===>>> Port directory: /usr/ports/security/openssl

    ===>>> This port is marked IGNORE
    ===>>> pkg(8) must be version 1.15.9 or greater, but you have 1.15.6. You must upgrade the ports-mgmt/pkg port first
```

So did

```
portmaster pkg
```

to make the pkg update happen first.  Then portmaster -a worked without complaint.


----------

