# re-getting/installing pkg with a broken pkg



## multix (Feb 1, 2020)

Hi all!
I did upgrade a Laptop which had an outdated 10.x to 11.x .. I followed the usual rule of upgrading packages before re-running freebsd-update, but evidently I did something wrong and so some dependencies are not cleaned (I think pkg did not upgrade all packages for some reason and I missed the error).

Now, I just cannot run "pkg" since it depends on an old version of a shared library. I tried creating some symlinks, to newer versions of the libraries, but that does not work.

Is there a trick to "reinstall" pkg?
On a fresh install, if I remember right, pkg is actually a script that does it for you. I hope that doing that could help me "boostrap" myself again.

Riccardo


----------



## getopt (Feb 1, 2020)

Try `pkg-static bootstrap -f` to force a re-installation of Pkg. See pkg(7).

Pkg uses fetch. If https is required, you might be able to get it to bootstrap by setting the SSL_NO_VERIFY_PEER environment variable temporarily until security/ca_root_nss is installed.


----------



## SirDice (Feb 3, 2020)

multix said:


> I tried creating some symlinks, to newer versions of the libraries, but that does not work.


Make sure to remove those. And remember that this is never a correct solution.


----------



## multix (Feb 20, 2020)

getopt said:


> Try `pkg-static bootstrap -f` to force a re-installation of Pkg. See pkg(7).
> 
> Pkg uses fetch. If https is required, you might be able to get it to bootstrap by setting the SSL_NO_VERIFY_PEER environment variable temporarily until security/ca_root_nss is installed.



pkg-static was the fine solution, thanks. It worked!


----------



## multix (Feb 20, 2020)

SirDice said:


> Make sure to remove those. And remember that this is never a correct solution.


I removed them immediately after checking they did not work. It is not the correct solution but sometimes it is a quick fix to get it running and then clean up later. Sometimes I had luck, sometimes not. This time not. But bootrastrap-static was the fix.


----------

