Using pkg to fetch packages for different ABI

Jason Unovitch jason.unovitch at gmail.com
Wed Feb 3 02:30:21 UTC 2016


On Tue, Feb 2, 2016 at 8:21 PM, Daniel Eischen <deischen at freebsd.org> wrote:
> I want to use pkg to maintain a set of packages for nanobsd
> systems that are a different OS version and ABI than the
> host system.  Basically, I want to be able to do:
>
>   # pkg fetch -d -r FreeBSD_10x_32 -o ./ <pkgname>
>
> and have it fetch all the required packages for <pkgname>.
>
> The host system is 10.2-RELEASE-p9 amd64, the target system
> in this case is similar, but just x86, not amd64.  pkg is
> version 1.6.2.
>
> Trying to initially update the repo catalog gives this:
>
>   # cat /usr/local/etc/pkg/repos/FreeBSD_10x_32.conf
>   FreeBSD_10x_32: {
>     ABI: "FreeBSD:x86:32"
>     url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:32/latest",
>     mirror_type: "srv",
>     signature_type: "fingerprints",
>     fingerprints: "/usr/share/keys/pkg",
>     enabled: yes
>   }
>
>   # pkg update -r FreeBSD_10x_32
>   Updating FreeBSD_10x_32 repository catalogue...
>   Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
>   Fetching packagesite.txz: 100%    5 MiB   2.8MB/s    00:02
>   Processing entries:   0%
>   pkg: wrong architecture: freebsd:10:x86:32 instead of FreeBSD:10:amd64
>   pkg: repository FreeBSD_10x_32 contains packages with wrong ABI:
> freebsd:10:x86:32
>   Processing entries: 100%
>   Unable to update repository FreeBSD_10x_32
>
> Why does 'pkg' care what the ABI is unless we try to actually
> install the packages?
>
> --
> DE

Set it via an environmental variable:
setenv ABI freebsd:10:x86:32

ABI can be overridden with environmental variables or via `-o
ABI=freebsd:10:x86:32'.  I'm actually using environmental variables on
a CentOS box with a locally compiled pkg to do a pkg fetch and pkg
repo to store a couple packages for internal use.


More information about the freebsd-ports mailing list