missing libssl.so.lll after upgrading to 14.1

root@BSD_DTP:~ # pkg update
ld-elf.so.1: Shared object "libssl.so.111" not found, required by "pkg"
What seems to be the problem? Can I simply find the libssl.so.111 and put to the proper directory?
 
Last edited by a moderator:
Same goes for gitup when I tried to update port tree.
 
Last edited by a moderator:
You don’t say what you’ve upgraded from but it’s something that had OpenSSL 1.1.

FreeBSD 14.1 has OpenSSL 3.0 in the base install.

So your version of pkg is linked to OpenSSL 1.1.

Follow tingo’s advice and if that doesn’t work explain what you upgraded from and what steps you took.

Definitely looks like a 13.x to 14.x upgrade where you’ve missed the userland and/or ports/package update steps.
 
If you are using pkg it install packages, you should re-bootstral pkg itself first with pkg_static bootstrap -f to fetch matching version and install.
After that, assuming you upgraded base from 13.x or before (not 14.0), you should pkg upgrade all packages installed (correct build of pkg should usually does the right things).
After that, if you want to confirm everything are reinstalled fine, you can download and use a script check_old_rel_pkgs_quick.sh I've uploaded here to look for remnants.
Note that, for some reason, some of packages you are using are not (yet or as removed) built for 14.0. You'd better dry-run with pkg upgrade -n before acutal upgrades (except pkg itself).
 
you should re-bootstral pkg itself first with pkg_static bootstrap -f to fetch matching version and install.
Although this will work the correct command should be pkg bootstrap -f. Note the difference between /usr/sbin/pkg (pkg(7)) and /usr/local/sbin/pkg{,-static} (pkg(8)).

pkg(7) (/usr/sbin/pkg):
Code:
       pkg [-46] bootstrap [-fy] [-r reponame]
	       Attempt	to bootstrap and do not	forward	anything to pkg(8) af-
	       ter it is installed.  With -4 and -6, pkg will  force  IPv4  or
	       IPv6 respectively to fetch pkg(8) and its signatures as needed.
	       If  the	-f  flag is specified, then pkg(8) will	be fetched and
	       installed regardless if it is already  installed.   If  the  -y
	       flag  is	 specified,  no	 confirmation will be asked when boot-
	       strapping pkg(8).

pkg(8) (/usr/local/sbin/pkg{,-static}):
Code:
       bootstrap
	       This is for compatibility with the pkg(7) bootstrapper.	If pkg
	       is already installed, nothing is	done.

	       If  invoked  with  the -f flag an attempt will be made to rein-
	       stall pkg from remote repository.
 
What seems to be the problem?
The problem originates from the failure to update/reinstall all your installed packages when told to do so (after the second freebsd-update install). The third and final freebsd-update install removes all the old libraries from the previous FreeBSD version. Thus breaking everything that depended on them.
 
Although this will work the correct command should be pkg bootstrap -f. Note the difference between /usr/sbin/pkg (pkg(7)) and /usr/local/sbin/pkg{,-static} (pkg(8)).
Basically, yes.
But for OP, pkg already fails with ld-elf.so.1: Shared object "libssl.so.111" not found, required by "pkg". So for this specific case, using pkg_static would be the only way to go.
 
So for this specific case, using pkg_static would be the only way to go.
No, that problem would be in /usr/local/sbin/pkg (installed from ports-mgmt/pkg), not in /usr/sbin/pkg (part of the base). pkg bootstrap -f executes /usr/sbin/pkg. As a matter of fact, /usr/sbin/pkg always gets executed (due to PATH), it just hands things over to /usr/local/sbin/pkg if it's installed.
 
No, that problem would be in /usr/local/sbin/pkg (installed from ports-mgmt/pkg), not in /usr/sbin/pkg (part of the base). pkg bootstrap -f executes /usr/sbin/pkg. As a matter of fact, /usr/sbin/pkg always gets executed (due to PATH), it just hands things over to /usr/local/sbin/pkg if it's installed.
So it shoud be /usr/sbin/pkg bootstrap -f or pkg_static bootstrap -f.
But if I recall/understand correctly, /usr/sbin/pkg kicks /usr/local/sbin/pkg if it already exists. This is because I suggested the latter. (As, by default, /usr/sbin/ should be searched for before /usr/local/sbin/.)
 
But if I recall/understand correctly, /usr/sbin/pkg kicks /usr/local/sbin/pkg if it already exists.
Yes, but bootstrap -f overrules this behavior and doesn't pass everything off to /usr/local/sbin/pkg, thus you're not triggering the missing library error. It does the exact same thing as if ports-mgmt/pkg hasn't been installed yet.
 
The problem originates from the failure to update/reinstall all your installed packages when told to do so (after the second freebsd-update install). The third and final freebsd-update install removes all the old libraries from the previous FreeBSD version. Thus breaking everything that depended on them.
You sure there is a reminder after the second freebsd-update install saying i should upgrade all packages? I don't remember seeing it.
 
Hi

I have a problem in my jail after upgrading it from 12.2-release to 14.1-release in one go,
that pkg is not working because of missing libraries and pkg-static is missing:

root@clonetest1:/ # pkg
ld-elf.so.1: Shared object "libarchive.so.7" not found, required by "pkg"
root@clonetest1:/ # pkg-static
pkg-static: Command not found.


How can i solve this without reinstall?
 
okey i did the transplant.
But this happened:

root@clonetest1:/ # pkg-static upgrade -f
Updating FreeBSD repository catalogue...
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
repository FreeBSD has no meta file, using default settings
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
Unable to update repository FreeBSD
Error updating repositories!
root@clonetest1:/ #

So my jail have more problems it seams ?
 
So i continued the transplant of every library that was missing to get freebsd-update and pkg to start working.

But i still having problems:


root@clonetest1:/var/db/freebsd-update # pkg-static bootstrap -f
pkg(8) is already installed. Forcing reinstallation through pkg(7).
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly, please wait...
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E5
0020E113953D0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/c
rypto/openssl/ssl/statem/statem_clnt.c:1890:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E5
0020E113953D0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/c
rypto/openssl/ssl/statem/statem_clnt.c:1890:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E5
0020E113953D0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/c
rypto/openssl/ssl/statem/statem_clnt.c:1890:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E5
0020E113953D0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/c
rypto/openssl/ssl/statem/statem_clnt.c:1890:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E5
0020E113953D0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/c
rypto/openssl/ssl/statem/statem_clnt.c:1890:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E5
0020E113953D0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/c
rypto/openssl/ssl/statem/statem_clnt.c:1890:
pkg: Error fetching https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/Latest/pkg.txz: Authentication error
A pre-built version of pkg could not be found for your system.
Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.


So i tried to get ca_root_nss:

/usr/ports/security/ca_root_nss # make install
make: "/usr/share/mk/sys.mk" line 279: Could not find bsd.suffixes.mk
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/security/ca_root_nss
root@clonetest1:/usr/ports/security/ca_root_nss # make install
===> Building/installing dialog4ports as it is required for the config dialog
===> Cleaning for dialog4ports-0.1.6
===> License BSD2CLAUSE accepted by the user
===> dialog4ports-0.1.6 depends on file: /usr/local/sbin/pkg - not found
===> Skipping 'config' as NO_DIALOG is defined
===> License BSD2CLAUSE accepted by the user
=> freebsd-pkg-1.17.1_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://codeload.github.com/freebsd/pkg/tar.gz/1.17.1?dummy=/freebsd-pkg-1.17.1_GH0.tar.gz
fetch: https://codeload.github.com/freebsd/pkg/tar.gz/1.17.1?dummy=/freebsd-pkg-1.17.1_GH0.tar.gz: size unknown
fetch: https://codeload.github.com/freebsd/pkg/tar.gz/1.17.1?dummy=/freebsd-pkg-1.17.1_GH0.tar.gz: size of remote fil
e is not known
freebsd-pkg-1.17.1_GH0.tar.gz 3803 kB 6765 kBps 01s
===> Fetching all distfiles required by pkg-1.17.1 for building
===> Extracting for pkg-1.17.1
===> License BSD2CLAUSE accepted by the user
===> Fetching all distfiles required by pkg-1.17.1 for building
=> SHA256 Checksum OK for freebsd-pkg-1.17.1_GH0.tar.gz.
===> Patching for pkg-1.17.1
===> Applying FreeBSD patches for pkg-1.17.1 from /usr/ports/ports-mgmt/pkg/files
/usr/bin/sed -i.bak -e "s|-llzma|-llzma -lmd|g" /usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/auto.def /usr/ports/ports-
mgmt/pkg/work/pkg-1.17.1/src/Makefile.autosetup /usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/tests/Makefile.autosetup
===> Configuring for pkg-1.17.1
No installed jimsh or tclsh, building local bootstrap jimsh0
No working C compiler found. Tried cc and gcc.
===> Script "configure" failed unexpectedly.
Please report the problem to pkg@FreeBSD.org [maintainer] and attach the
"/usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/config.log" including the output
of the failure of your make command. Also, it might be a good idea to provide
an overview of all packages installed on your system (e.g. a
/usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/src/pkg-static info -g -Ea).
*** Error code 1

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

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

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

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

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/dialog4ports
===> Options unchanged
===> License MPL20 accepted by the user
===> ca_root_nss-3.68 depends on file: /usr/local/sbin/pkg - not found
===> Building/installing dialog4ports as it is required for the config dialog
===> Cleaning for pkg-1.17.1
===> Cleaning for dialog4ports-0.1.6
===> License BSD2CLAUSE accepted by the user
===> dialog4ports-0.1.6 depends on file: /usr/local/sbin/pkg - not found
===> Skipping 'config' as NO_DIALOG is defined
===> License BSD2CLAUSE accepted by the user
===> Fetching all distfiles required by pkg-1.17.1 for building
===> Extracting for pkg-1.17.1
===> License BSD2CLAUSE accepted by the user
===> Fetching all distfiles required by pkg-1.17.1 for building
=> SHA256 Checksum OK for freebsd-pkg-1.17.1_GH0.tar.gz.
===> Patching for pkg-1.17.1
===> Applying FreeBSD patches for pkg-1.17.1 from /usr/ports/ports-mgmt/pkg/files
/usr/bin/sed -i.bak -e "s|-llzma|-llzma -lmd|g" /usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/auto.def /usr/ports/ports-
mgmt/pkg/work/pkg-1.17.1/src/Makefile.autosetup /usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/tests/Makefile.autosetup
===> Configuring for pkg-1.17.1
No installed jimsh or tclsh, building local bootstrap jimsh0
No working C compiler found. Tried cc and gcc.
===> Script "configure" failed unexpectedly.
Please report the problem to pkg@FreeBSD.org [maintainer] and attach the
"/usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/config.log" including the output
of the failure of your make command. Also, it might be a good idea to provide
an overview of all packages installed on your system (e.g. a
/usr/ports/ports-mgmt/pkg/work/pkg-1.17.1/src/pkg-static info -g -Ea).
*** Error code 1

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

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



This jail is having even bigger problems is seams.
How can i solve this mess?
 
Oh i forgot that /usr/local/ is empty, which is interesting ,,
I will precede with the transplant.
So i continued the transplant of every library that was missing to get freebsd-update and pkg to start working.
At this point I would create a fresh 14.1 jail.

freebsd-update(8) is a base tool, when this tool has problems to run without library transplant, then the upgrade didn't go well.

I assume from the hostname "clonetest1" this is a test jail cloned from the original. Get from the original jail a pkg prime-list > prime-list, all base system and 3rd party applications configuration, transfer to new 14.1 jail, install 3rd party packages along with ports-mgmt/pkg ( pkg install `cat prime-list`) , move important data from 12.2 to 14.1 jail.


If you insist of using the affected jail, try from inside the jail:
Code:
 # pkg  fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/All/pkg-1.21.3.pkg

 # pkg-static add -f /<absolute>/<path>/pkg-1.21.3.pkg

If there is a complain about missing package signature:
Code:
 # env SIGNATURE_TYPE=none pkg-static add -f /<absolute>/<path>/pkg-1.21.3.pkg

If fetching pkg is not possible from the jail due to certificate verification failing, fetch it from the host.

When already on host you might try as well to mange from there the packages inside the jail.

pkg(8)
Code:
     -r ⟨root directory⟩, --rootdir ⟨root directory⟩
             pkg will install all packages within the specified ⟨root
             directory⟩.

Code:
 # pkg  -r  /path/to/jails/root  install  -f  pkg
or
 # pkg  -r  /path/to/jails/root  add  -f  /<absolute>/<path>/pkg-1.21.3.pkg


Apropos host, in case it's not, make sure the hosts version is equal or greater than the jails.
 
At this point I would create a fresh 14.1 jail.

freebsd-update(8) is a base tool, when this tool has problems to run without library transplant, then the upgrade didn't go well.

I assume from the hostname "clonetest1" this is a test jail cloned from the original. Get from the original jail a pkg prime-list > prime-list, all base system and 3rd party applications configuration, transfer to new 14.1 jail, install 3rd party packages along with ports-mgmt/pkg ( pkg install `cat prime-list`) , move important data from 12.2 to 14.1 jail.


If you insist of using the affected jail, try from inside the jail:
Code:
 # pkg  fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/All/pkg-1.21.3.pkg

 # pkg-static add -f /<absolute>/<path>/pkg-1.21.3.pkg

If there is a complain about missing package signature:
Code:
 # env SIGNATURE_TYPE=none pkg-static add -f /<absolute>/<path>/pkg-1.21.3.pkg

If fetching pkg is not possible from the jail due to certificate verification failing, fetch it from the host.

When already on host you might try as well to mange from there the packages inside the jail.

pkg(8)
Code:
     -r ⟨root directory⟩, --rootdir ⟨root directory⟩
             pkg will install all packages within the specified ⟨root
             directory⟩.

Code:
 # pkg  -r  /path/to/jails/root  install  -f  pkg
or
 # pkg  -r  /path/to/jails/root  add  -f  /<absolute>/<path>/pkg-1.21.3.pkg


Apropos host, in case it's not, make sure the hosts version is equal or greater than the jails.
Thanks for all of your suggestions

I do want to get this jail to work again as if i do, i will be able to fix if this situation happens to a important system.

So i tried to get pkg to install pkg from the jail and this happened:

Code:
root@clonetest1:/var/db/pkg/repos/FreeBSD # pkg -d fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/All/pkg-1.21.3.pkg
DBG(1)[44621]> pkg initialized
Updating FreeBSD repository catalogue...
DBG(1)[44621]> PkgRepo: verifying update for FreeBSD
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
DBG(1)[44621]> PkgRepo: need forced update of FreeBSD
DBG(1)[44621]> Pkgrepo, begin update of '/var/db/pkg/repos/FreeBSD/db'
DBG(1)[44621]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/meta.conf
DBG(1)[44621]> curl_open
DBG(1)[44621]> Fetch: fetcher used: pkg+https
DBG(1)[44621]> curl> fetching https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/meta.conf

DBG(1)[44621]> CURL> attempting to fetch from , left retry 3

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Host pkgmir.geo.freebsd.org:443 was resolved.
* IPv6: (none)
* IPv4: 85.30.190.140
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 2

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 1

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
pkg: An error occured while fetching package
DBG(1)[44621]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/meta.txz
DBG(1)[44621]> curl_open
DBG(1)[44621]> Fetch: fetcher used: pkg+https
DBG(1)[44621]> curl> fetching https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/meta.txz

DBG(1)[44621]> CURL> attempting to fetch from , left retry 3

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 2

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 1

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
pkg: An error occured while fetching package
repository FreeBSD has no meta file, using default settings
DBG(1)[44621]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/data.pkg
DBG(1)[44621]> curl_open
DBG(1)[44621]> Fetch: fetcher used: pkg+https
DBG(1)[44621]> curl> fetching https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/data.pkg

DBG(1)[44621]> CURL> attempting to fetch from , left retry 3

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 2

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 1

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
pkg: An error occured while fetching package
DBG(1)[44621]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/data.txz
DBG(1)[44621]> curl_open
DBG(1)[44621]> Fetch: fetcher used: pkg+https
DBG(1)[44621]> curl> fetching https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/data.txz

DBG(1)[44621]> CURL> attempting to fetch from , left retry 3

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 2

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 1

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
pkg: An error occured while fetching package
DBG(1)[44621]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/packagesite.pkg
DBG(1)[44621]> curl_open
DBG(1)[44621]> Fetch: fetcher used: pkg+https
DBG(1)[44621]> curl> fetching https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/packagesite.pkg

DBG(1)[44621]> CURL> attempting to fetch from , left retry 3

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 2

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 1

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
pkg: An error occured while fetching package
DBG(1)[44621]> Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/packagesite.txz
DBG(1)[44621]> curl_open
DBG(1)[44621]> Fetch: fetcher used: pkg+https
DBG(1)[44621]> curl> fetching https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/packagesite.txz

DBG(1)[44621]> CURL> attempting to fetch from , left retry 3

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 2

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
DBG(1)[44621]> CURL> attempting to fetch from , left retry 1

* Couldn't find host pkgmir.geo.freebsd.org in the .netrc file; using defaults
* Hostname pkgmir.geo.freebsd.org was found in DNS cache
*   Trying 85.30.190.140:443...
* Connected to pkgmir.geo.freebsd.org (85.30.190.140) port 443
* ALPN: curl offers http/1.1
*  CAfile: none
*  CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection
pkg: An error occured while fetching package
Unable to update repository FreeBSD
Error updating repositories!
root@clonetest1:/var/db/pkg/repos/FreeBSD #

I have applied debug on the command to see what is really happened.

I believe thast this is the root of the problem:"SSL certificate problem: unable to get local issuer certificate".
I can be wrong and i don't know how to solve it?

When it didn't work to get pkg from within the jail i tried the other suggestion, from the host and that worked without problem:


Code:
root@Backup:/home/drift # pkg -r /usr/local/jails/clonetest1/ install -f pkg
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    178 B   0.2kB/s    00:01     
Fetching data.pkg: 100%    7 MiB   7.5MB/s    00:01     
Processing entries: 100%
FreeBSD repository update completed. 35389 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        pkg-1.21.3

Number of packages to be reinstalled: 1

12 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching pkg-1.21.3.pkg: 100%   12 MiB   6.2MB/s    00:02     
Checking integrity... done (0 conflicting)
[1/1] Reinstalling pkg-1.21.3...
[1/1] Extracting pkg-1.21.3: 100%


But i still have the same problem within the jail that pkg is not working.
 
# pkg fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/All/pkg-1.21.3.pkg
So i tried to get pkg to install pkg from the jail and this happened:
root@clonetest1:/var/db/pkg/repos/FreeBSD # pkg -d fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/All/pkg-1.21.3.pkg
I'm sorry, there was a typo. The command should have been fetch https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly/All/pkg-1.21.3.pkg, not pkg fetch ...


But i still have the same problem within the jail that pkg is not working.
I assume you are referring to the certificate problem. Just install security/ca_root_nss from host as you did for ports-mgmt/pkg
 
Back
Top