Hi! pkg-static(8) can be used in chroot environment having no networking to populate it with pre-downloaded set of package files, that is: pkg-static install -yU *.txz It fails with non-descriptive error if such set of files has two different versions of the same package. It is easy to reproduce this without mentioned chroot environment, too. # fetch http://pkg.freebsd.org/FreeBSD:11:amd64/release_0/All/snappy-1.1.3.txz # fetch http://pkg.freebsd.org/FreeBSD:11:amd64/release_1/All/snappy-1.1.4.txz # pkg install -yU snappy-1.1.3.txz snappy-1.1.4.txz Checking integrity... done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: snappy: 1.1.4 Number of packages to be installed: 1 pkg: archive_read_open_filename((null)): Failed to open '(null)' More understandable error message is expected. Also, '(null)' points to some internal logic error.
I ran into this issue this morning using pkg 1.10.3 trying to reinstall a custom-built package: # pkg --version 1.10.3 # pkg -d install -y /tmp/ldb-1.1.29_1.txz DBG(1)[34197]> pkg initialized Updating FreeBSD repository catalogue... DBG(1)[34197]> PkgRepo: verifying update for FreeBSD DBG(1)[34197]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite' DBG(1)[34197]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/latest/meta.txz with opts "i" DBG(1)[34197]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/latest/packagesite.txz with opts "i" FreeBSD repository is up to date. All repositories are up to date. DBG(1)[34197]> want to get an advisory lock on a database DBG(1)[34197]> Jobs> Adding file: /tmp/ldb-1.1.29_1.txz DBG(1)[34197]> removing ldb from the request as it is the same as local DBG(1)[34197]> trying to delete local package ldb-1.1.29_1 on install/upgrade, reiterate on SAT Checking integrity...DBG(1)[34197]> Binary> loading /var/cache/pkg/ldb-1.1.29_1-c96c1cd1cd.txz DBG(1)[34197]> check integrity for 1 items added done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): Installed packages to be REINSTALLED: ldb-1.1.29_1 Number of packages to be reinstalled: 1 DBG(1)[34197]> want to upgrade advisory to exclusive lock pkg: archive_read_open_filename((null)): Failed to open '(null)' DBG(1)[34197]> release an exclusive lock on a database DBG(1)[34197]> release an advisory lock on a database
This is not an individual problem. See pkg -d install xmltooling-1.6.3_1.txz DBG(1)[39685]> pkg initialized Updating FreeBSD repository catalogue... DBG(1)[39685]> PkgRepo: verifying update for FreeBSD DBG(1)[39685]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite' DBG(1)[39685]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/quarterly/meta.txz with opts "i" DBG(1)[39685]> Fetch: fetching from: http://pkgmir.geo.freebsd.org/FreeBSD:11:amd64/quarterly/packagesite.txz with opts "i" FreeBSD repository is up to date. All repositories are up to date. DBG(1)[39685]> want to get an advisory lock on a database DBG(1)[39685]> Jobs> Adding file: xmltooling-1.6.3_1.txz DBG(1)[39685]> removing xmltooling from the request as it is the same as local DBG(1)[39685]> trying to delete local package xmltooling-1.6.2 on install/upgrade, reiterate on SAT Checking integrity...DBG(1)[39685]> check integrity for 1 items added done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): Installed packages to be UPGRADED: xmltooling: 1.6.2 -> 1.6.3_1 Number of packages to be upgraded: 1 Proceed with this action? [y/N]: y DBG(1)[39685]> want to upgrade advisory to exclusive lock pkg: archive_read_open_filename((null)): Failed to open '(null)' DBG(1)[39685]> release an exclusive lock on a database DBG(1)[39685]> release an advisory lock on a database
Can you try using `pkg add' ? IIRC, that goes around a lot of the code involved with repo handling.
(In reply to Brad Davis from comment #3) "pkg add" works. But this PR is about some logic errors in the "pkg install".
From the testing I cannot reproduce anymore, I remember fixing something like this in the past. If not please reopen the PR.
# pkg --version 1.17.4 # pkg -d install /var/cache/pkg/libmediainfo-20.09.txz DBG(1)[25981]> pkg initialized Updating FreeBSD repository catalogue... DBG(1)[25981]> PkgRepo: verifying update for FreeBSD DBG(1)[25981]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite' DBG(1)[25981]> Request to fetch pkg+http://pkg.eu.FreeBSD.org/FreeBSD:12:amd64/latest/meta.conf DBG(1)[25981]> opening libfetch fetcher DBG(1)[25981]> Fetch > libfetch: connecting DBG(1)[25981]> Fetch: fetching from: http://pkg0.bme.freebsd.org/FreeBSD:12:amd64/latest/meta.conf with opts "i" DBG(1)[25981]> Request to fetch pkg+http://pkg.eu.FreeBSD.org/FreeBSD:12:amd64/latest/packagesite.pkg DBG(1)[25981]> opening libfetch fetcher DBG(1)[25981]> Fetch > libfetch: connecting DBG(1)[25981]> Fetch: fetching from: http://pkg0.bme.freebsd.org/FreeBSD:12:amd64/latest/packagesite.pkg with opts "i" DBG(1)[25981]> Request to fetch pkg+http://pkg.eu.FreeBSD.org/FreeBSD:12:amd64/latest/packagesite.txz DBG(1)[25981]> opening libfetch fetcher DBG(1)[25981]> Fetch > libfetch: connecting DBG(1)[25981]> Fetch: fetching from: http://pkg0.bme.freebsd.org/FreeBSD:12:amd64/latest/packagesite.txz with opts "i" FreeBSD repository is up to date. All repositories are up to date. DBG(1)[25981]> want to get an advisory lock on a database DBG(1)[25981]> Jobs> Adding file: /var/cache/pkg/libmediainfo-20.09.txz DBG(1)[25981]> removing libmediainfo from the request as it is the same as local DBG(1)[25981]> solver: for package: libmediainfo cannot find provide for requirement: libtinyxml2.so.8 DBG(1)[25981]> trying to delete local package libmediainfo-21.09 on install/upgrade, reiterate on SAT Checking integrity...DBG(1)[25981]> check integrity for 1 items added done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): Installed packages to be DOWNGRADED: libmediainfo: 21.09 -> 20.09 Number of packages to be downgraded: 1 Proceed with this action? [y/N]: y DBG(1)[25981]> want to upgrade advisory to exclusive lock pkg: archive_read_open_filename((null)): Failed to open '(null)' DBG(1)[25981]> release an exclusive lock on a database DBG(1)[25981]> release an advisory lock on a database I still see this issue
This is reproducible with pkg-1.17.5_1 under 13.1-STABLE/amd64 # pkg install -yU rsync-3.2.3_1.pkg rsync-3.2.4.pkg Checking integrity... done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: rsync: 3.2.4 Number of packages to be installed: 1 pkg: archive_read_open_filename((null)): Failed to open '(null)'
I just encountered this after building x11-fm/thunar using `make install-missing-packages; env USE_PACKAGE_DEPENDS_ONLY=yes make package; pkg install work/pkg/...`; `pkg add -f work/pkg/...` worked without problems.