multi-architecture package repos

OS: FreeBSD 12.4, ABI amd64.

what I am trying to do is to enable multi-architecture pkg repos, i.e. to have both amd64 and i386.

what I did is I made a conf file under /usr/local/etc/pkg/repos/*.conf
and set the url to FreeBSD:12:i386.

tried to run pkg update, it fetched all required i386 files, but failed to update repository, because the OS is amd64 and I already have an amd64 repo exist under pkg/repos.

is there any way to have both amd64 and i386 repos enabled at the same time?
 
I am sure you did not read my first post properly, here is an attachment,
 

Attachments

  • IMG_20230112_140119.jpg
    IMG_20230112_140119.jpg
    1.9 MB · Views: 104
Please don't post pictures of text. They're impossible to quote from. Just copy/paste the actual text in a [code]...[/code] block.

That said, you have two seperate repositories defined and they're both enabled. But pkg(8) will refuse to install packages from a different architecture than the host.

tried to run pkg update, it fetched all required i386 files,
It only fetches and caches a local copy of the catalog.

because the OS is amd64 and I already have an amd64 repo exist under pkg/repos.
This local catalog will be saved in a different SQLite database. If you look in /var/db/pkg you will see repo-<name>.sqlite. Each repository will have its own local database containing the catalog. The reason you're getting this error is because your system is AMD64 and you're trying to save a catalog intended for i386. That's the issue, not the fact you have an existing AMD64 catalog. Your AMD64 catalog will be saved in repo-FreeBSD.sqlite and the i386 would be saved in repo-FreeBSDx86.sqlite. So there's no conflict with regards to saving the catalog.
 
On this system I have two repositories enabled, the default FreeBSD one and a custom repository:
Code:
root@fbsd-test:~ # ll /var/db/pkg/
total 88591
-rw-r--r--  1 root  wheel       158 Jan 11 03:43 FreeBSD.meta
-rw-r--r--  1 root  wheel       158 Jan 12 13:47 dicelan.meta
-rw-r--r--  1 root  wheel  15089664 Jan 12 03:02 local.sqlite
-rw-r--r--  1 root  wheel  54644736 Jan 11 03:43 repo-FreeBSD.sqlite
-rw-r--r--  1 root  wheel   2682880 Jan 11 13:20 repo-dicelan.sqlite
-rw-r--r--  1 root  wheel         0 Jan 12 13:47 repo-dicelan.sqlite-journal
-r--r--r--  1 root  wheel   7359814 Jan 11 03:11 vuln.xml
Code:
Repositories:
  FreeBSD: {
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  dicelan: {
    url             : "http://_internal_server/packages/FreeBSD:13:amd64",
    enabled         : yes,
    priority        : 0
  }
Notice how the name of the repository is reflected in the name of the repo-*.sqlite database files?
 
As for the naming convention of the packages, they're going to clash. The architecture isn't included in the package name, so if you try to install apache24 for example it can't tell the difference between apache24-2.4.54.pkg (for amd64) and apache24-2.4.54.pkg (for i386), the intended architecture is stored in metadata inside the package.
 
sorry I dont have gui to copy/paste.

still, this does not solve my problem.
also repo-FreeBSDx86.sqlite is 0, as it couldnt update it.

perhaps there is a way to overcome this limitation, at least to be able to search in i386 repo?

yes I am aware of naming convention, the only way around is to install the i386 package in my home directory.

thank you for the details.
 
is there any way to have both amd64 and i386 repos enabled at the same time?
Yes it's possible, only you need to set the ABI environment of the i386 repository.

For example, if there is a i386 repository configuration named "12-i386", to create and update that repository database:
Code:
 # env ABI=FreeBSD:12:i386 pkg update -r 12-i386

Afterwards, i386 packages, if desired, can be pkg-fetch(8)ed locally in a separate repository (not the default in /var/cache/pkg), e.g.:
Code:
 # pkg fetch -r 12-i386 -o /var/cache/pkg-i386 <package_name>
 
I was able to update my (repo-FreeBSDx86.sqlite) using:
pkg -o ABI=FreeBSD:12:i386 update -r FreeBSDx86
now I can search and install successfully.
thank you.
 
Back
Top