18

I have a strange thing I cannot figure out. Have checked manpages, etc. So hoping someone else had the same issue.

To convert from a normal .list file to a .sources file, as is now used in Ubuntu 24.04 LTS, I will use tor as an example:

Old way (tor.list):

deb [arch=amd64> signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org jammy main
deb-src [arch=amd64> signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org jammy main

New Way (tor.sources):

Types: deb
URIs: https://deb.torproject.org/torproject.org
Suites: jammy
Components: main
Signed-By: /usr/share/keyrings/tor-archive-keyring.gpg

The problem I have is this:

In the tor.sources, from what I can find, there is no way to specify the arch / architecture. I've tried arch, architecture, system, etc. Nothing works.

This is the error I get:

N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://deb.torproject.org/torproject.org jammy InRelease' doesn't support architecture 'i386'

I know this is a cosmetic thing and it mostly just effects logs, etc. But, simply finding a way to specify the arch would fix this entirely.

Anyone has any ideas?

Alexis Wilke
  • 2,787

2 Answers2

20

Technically, .sources files in the deb822 format have only three mandatory keys: Types, URIs and Suites. All other keys are optional keys. If the sources are signed - which is common to ensure the sources are not compromised - the Signed-By becomes necessary as well. The Components key is not mandatory, but due to the way the Ubuntu sources (and many other sources) are structured, the field is often necessary, too.

Except these mandatory and common keys, .sources file can of multiple other, optional keys. Among them is the Architectures key to specify that only packages for certain CPU architectures should be considered. Architectures: amd64 would only consider packages from this package source for the amd64 architecture only and ignore other packages (e.g. for arm64 or armhf) if present in the repo.

A full list of other, optional keys which can be used in .sources files can be found in the sources.list manpage, section "THE DEB AND DEB-SRC TYPES: OPTIONS".

However, .list files and the known one-liner format defining a package source still work in Ubuntu 24.04 LTS. Ubuntu 24.04 is just the first Ubuntu release where the packages sources for Ubuntu are defined in a .sources file named /etc/apt/sources.list.d/ubuntu.sources instead of a sources.list file. It is no problem to mix .sources and .list file on the same system - of course for different sources - APT can handle that. .sources files also already work in Ubuntu 20.04, Ubuntu 22.04 etc., it is just not common to use them for older releases.

noisefloor
  • 1,769
18

Use the following line to specify the arch:

Architectures: amd64

I found the answer on the RepoLib website after googling the technical name "DEB822" source format (name of the new .sources file style). While it isn't the original documentation, they do provide a few examples and a pretty good explanation of the DEB822 source format.

mchid
  • 44,904
  • 8
  • 102
  • 162